Free Support Forum - aspose.com

Cloning is costly?

Hello,
Cloning of slides and cloning of slide masters is costly operation. The Air Arabia ppt has 29 slides, and we’re using the following code -
String dirUrl = “Clone is costly\”;
String sample = “Air Arabia IR Presentation Q1 2014.pptx”;
String doclet = “Nasa FY13AnnualReport_V4.pptx”;

long start = System.currentTimeMillis();
Presentation samplePpt = new Presentation(dirUrl + sample);
System.out.println(“A” + (System.currentTimeMillis() - start));

start = System.currentTimeMillis();
Presentation dcltPpt = new Presentation(dirUrl + doclet);
System.out.println(“B” + (System.currentTimeMillis() - start));

IMasterSlideCollection sampleMasters = samplePpt.getMasters();
IMasterSlideCollection docletMasters = dcltPpt.getMasters();
for (IMasterSlide master : sampleMasters) {
start = System.currentTimeMillis();
docletMasters.addClone(master);
System.out.println(“C” + (System.currentTimeMillis() - start));
}

for (ISlide slide: samplePpt.getSlides()) {
start = System.currentTimeMillis();
dcltPpt.getSlides().addClone(slide);
System.out.println(“D” + (System.currentTimeMillis() - start));
}

start = System.currentTimeMillis();
dcltPpt.save(dirUrl + doclet + “_MastersAdded.pptx”, SaveFormat.Pptx);
System.out.println(“E” + (System.currentTimeMillis() - start));

Output - {A32880, B3250, C502, D298, D319, D251, D21, D16141, D466, D63, D598, D296, D275, D218, D425, D284, D451, D345, D477, D598, D610, D653, D1054, D811, D565, D558, D584, D3989, D227, D304, D363, D211, E10953}

Please see the timings we’re seeing here for cloning of masters - “C”, and cloning time of slides (total 29 slides times staring with D). See some slides are going beyond .5 seconds.

Hi,


Thank you for your inquiry.

I have observed your requirements and the presentation file shared by you. I would like to share with you that cloning of slides with media content takes comparatively more time as compared to cloning of slides without any media content. You can verify at your end that the slides with media content is taking more time in the observations shared by you.

I hope this will clarify the concept. Please share if I may help you further in this regard.

Best Regards,