CEP API performance questions
Hi,
I'm looking into creating some sort of a Git for the PPro sequences using CEP and ExtendedScript, but I am concerned about the performance.
For example, in my testing it takes around 1ms to access one clip object from the first video track of the active sequence (I am not caching variables here for example purposes)
app.project.sequences[0].videoTracks[0].clips[0]and around 1.5ms to access a property of a component of a clip (again, not caching variables here for example purposes)
app.project.sequences[0].videoTracks[0].clips[0].components[2].properties[7]All the times have been tested by evalFile-ing my JSX file with the code. Here's the code that does the profiling
var time = 0;
var len = 1000;
var ___i;
for(___i = 0; ___i < len; ___i++){
$.hiresTimer;
app.project.sequences[0].videoTracks[0].clips[0].components[2].properties[7]
time += $.hiresTimer;
}
var avgTime = time / len;
On a farely large sequence (around 200clips, each with effects and some keyframes), just iterating through all tracks, clips, components, properties and keyframes takes around 40 seconds, time in which the JSX core is completely blocked.
There's also a concern about performance degradation. The more I run the code which fetches all the sequent's info, the slower it gets (relative to the size of the sequence). I've tried to run `$.gc()` a couple of times in between the fetches, but to no avail.
Is there a way to get the sequence's data in a faster manner? Should I not be using the ES Core for DOM accesses?
