Making the reference and active is done before calling the function so I would expect the performance hit there and not the function.
I misspoke. I meant to say the making obtaining a DOM reference to the active layer is the problem, which is apparently no longer the case. It may be that PS-JS is deferring some of the actual layer's DOM object construction until a property is actually referenced.
If that's the case, then the
- Code: Select all
this.layerWidth = layer.bounds.value - layer.bounds.value;
will be where the majority of the cycles are getting burned. I recommend running the test again using line-level profiling in ESTK to determine precisely where the cpu is spending the bulk of its time.