Hi,
I’m experiencing the similar issues in our project. Here are log entries and you can see that AddClone requires sometimes several seconds:
06 Nov 2025 18:24:23.072 Masters.AddClone(sourceMasterSlide) // <- ~1sec
06 Nov 2025 18:24:22.046 Masters.AddClone(sourceMasterSlide) // <- 4+ secs
06 Nov 2025 18:24:17.434 Masters.RemoveAt(0)
This is the part of the code:
public Presentation CreateFromSlide(ISlide slide)
{
var sourcePresentation = slide.Presentation;
using var targetPresentation = new Presentation();
// remove empty slide and its master created by default
targetPresentation.Slides.RemoveAt(0);
_logger.LogInformation("Slides.RemoveAt(0)");
targetPresentation.Masters.RemoveAt(0);
_logger.LogInformation("Masters.RemoveAt(0)");
foreach (var sourceMasterSlide in sourcePresentation.Masters)
{
if (targetPresentation.Masters.Any(m => m.Name == sourceMasterSlide.Name))
{
continue;
}
targetPresentation.Masters.AddClone(sourceMasterSlide);
_logger.LogInformation("Masters.AddClone(sourceMasterSlide)");
}
// ...
I noticed that @id2700 's case is also happens inside the loop, however @Professionalize.Discourse provided just the simplest example… Can any loop behaviour be involved to that performance issue?