Hello!
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
Mono 6.12.0.182
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();
watch.Start();
var doc1 = new Presentation(pptPath);
doc1.Save(output, SaveFormat.Pptx);
watch.Stop();
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();
watch2.Start();
var doc2 = new Presentation(pptPath);
doc2.Save(output2, SaveFormat.Pptx);
watch2.Stop();
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);
}
}
}