2 Replies Latest reply: Aug 9, 2013 9:34 AM by drelidan RSS

    Is there a performance difference between Automation Plug-ins and the scripting system?

    drelidan Community Member

      We currently have a tool that, through the scripting system, merges and hides layers by layer groups, exports them, and then moves to the next layer group.  There is some custom logic and channel merging that occasionally occurs in the merging of an individual layer group.  These operations are occuring through the scripting system (actually, through C# making direct function calls through Photoshop), and there are some images where these operations take ~30-40 minutes to complete on very large images.

       

      Is there a performance difference between doing the actions in this way as opposed to having these actions occur in an automation plug-in?

       

      Thanks,

        • 1. Re: Is there a performance difference between Automation Plug-ins and the scripting system?
          Tom Ruark Adobe Employee

          Are you using the DOM or the ActionDescriptor, ActionList, ActionReference API? There is a significant slow down using the DOM when looping over the layers. I have that as an item to improve but for a document with large layers, 100+ I would advise trying to get the layer + layer set count via ActionDescriptor and loop them that way. It is a lot of work however! Hopefully I can improve it soon and you wont have to deal with writing a workaround.

          • 2. Re: Is there a performance difference between Automation Plug-ins and the scripting system?
            drelidan Community Member

            Thanks for the reply.    I ended up just benchmarking the current implementation that we are using (which goes through DOM from all indications, I wasn't the original author of the code) and found that accessing each layer was taking upwards of 300 ms.  I benchmarked iterating through the layers with PIUGetInfoByIndexIndex (in the Getter automation plug-in) and found that the first layer took ~300 ms, but the rest took ~1 ms.  With that information, I decided that it was worthwhile rewriting the functionality in an Automation plug-in.