I've been seeing very slow performance in an addon I am currently developing. I have tracked down the major slowdown to needing to iterate layers a lot.
While testing, I added a simple forEach iteration for layers just to see if the iteration or the code action for layers was the problem. And the below line runs at almost exactly the same speed.
Is there a faster way to check all the layers under a layer in UXP?
Sample code:
layer.layers.forEach((elem)=> {});
The above line takes 250ms to run one time, and I am doing this for multiple layers. So I end up with a routine I was expecting to take a second maximum taking 20 plus seconds, which is rather painful to do on document select/open/close.