Presentation.Save Method in Aspose.Slides for .NET 23.2 Is Slow the First Time

I noticed that first call of Presentation.Save method is much slower then second one. On my computer I have following results:
Time 00:01:26.02
Time2 00:00:00.33

Why is such difference? And is there any way to speed up first call?

My environment:
Aspose.Slides 23.2.0

Here is an example:

using System;
using System.Diagnostics;
using Aspose.Slides;
using Aspose.Slides.Export;

namespace AsposeSlides_Test
    class MainClass
        public static void Main(string[] args)
            var pptPath = "pptexamples.ppt";
            var output = "pptexamples.pptx";

            Stopwatch watch = new Stopwatch();

            var doc1 = new Presentation(pptPath);
            doc1.Save(output, SaveFormat.Pptx);

            var ts = watch.Elapsed;
            string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
            Console.WriteLine("Time " + elapsedTime);


            var output2 = "pptexamples2.pptx";
            Stopwatch watch2 = new Stopwatch();

            var doc2 = new Presentation(pptPath);
            doc2.Save(output2, SaveFormat.Pptx);

            var ts2 = watch2.Elapsed;
            string elapsedTime2 = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts2.Hours, ts2.Minutes, ts2.Seconds, ts2.Milliseconds / 10);
            Console.WriteLine("Time2 " + elapsedTime2);

Thank you for posting the questions.

When the Presentation class is used, some static resources may be loaded for the first time, and some static properties may be lazy-initialized. Therefore, presentation methods may work slower the first time they are called.

If the issue is critical for you, please share the following files and information:

  • presentation file you used
  • OS version on which the code was executed
  • .NET target platform in your app

We will then try to find the cause of the problem you described and improve performance if possible.

I run this code on Ubuntu 20.04 and Fedora 37 with Mono
This zip file contains presentations (1.9 MB)


Thank you for the additional information and presentation files.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNET-43856

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.