Hello, did you try multiple runs and did you use the same document? Sometimes the first run can take a bit longer than the subsequent one. I just want to make sure that it is measured correctly before digging deeper Also could upload the PSD file please so I could try it myself? If I could reproduce issue I could possibly fix it.
Yes, definitely tried it multiple times and with different approaches.
Funnily, first load of the plugin was a bit faster than the later ones
I tried uploading .psd file, but it’s not a permitted format to upload.
Here’s the hierarchy of my PSD file:
That is it? 3 layers and 4 groups? That really shouldn’t take 5.5 seconds.
The problem with DOM is that it does not cache anything so even if you don’t change anything in document it always ask PS for fresh data again and again which can add up when you have a lot of iterations.
Well it stores the instance of layer. But when you ask for layer name it asks Photoshop and gets result back. So name itself is not stored in layer. There is stored only a getter who knows how to get layer name. Otherwise you would get really easily out of sync and would be easy to make error.
The problem with Modal Execution is that other plugins can’t run during that period. This is the problem in cases when your plugin reacts to some events. If that reacts to button click then it should be fine