1 Reply Latest reply on Sep 22, 2014 2:17 AM by c.pfaffenbichler

    What are some common performance tips for ExtendScript?

    rixter123 Level 1

      Are there any common tips (read: design patterns) that would help the performance of a long-running script? I mean, without a specific case, some general tips.


      For example, when looping over layers, it's better not to query the number of layers at each iteration.


      That is,

      for (var i = 0, len = set.layers.length; i < len; i++) { .... }

      is faster than

      for (var i = 0; i < set.layers.length; i++) { ... }

      That's a simple optimization off the top of my head.