Copy link to clipboard
Copied
dataSet = JSON.stringify(dataSet);
dataSet = encodeURIComponent(dataSet);
extendScriptFunction = `extendScriptFunction('${dataSet}')`;
csInterface.evalScript(extendScriptFunction, extendScriptReturn => {
//Handle extendScriptReturn
//Just for reference...
dataSet = decodeURIComponent(dataSet); // Takes 19ms
dataSet = JSON.parse(dataSet); // Takes 25ms
});
//Note: 7mb dataSet arrives to ExtendScript quickly, no problem
extendScriptFunction = function(dataSet){
dataSet = decodeURIComponent(dataSet); // Takes 199ms
dataSet = JSON.parse(dataSet); // Takes 143314ms -- 2 minutes!!!
}
None of which I'm aware; you're the first to report the issue.
Note: The JSON object available through PPro's ExtendScript API, is provided by, and contingent on the visibility of, the CC Libraries panel.
Since you can't trust that every user will always have the Libraries panel open, many panels rely on Douglas Crockford's json2.js.
Copy link to clipboard
Copied
None of which I'm aware; you're the first to report the issue.
Note: The JSON object available through PPro's ExtendScript API, is provided by, and contingent on the visibility of, the CC Libraries panel.
Since you can't trust that every user will always have the Libraries panel open, many panels rely on Douglas Crockford's json2.js.
Copy link to clipboard
Copied
@Bruce Bullis Thanks for the insight. I was on the hunt for possible JSON libraries that by some miracle might perform better and came across the same library but at a different link. Just tried the library you linked to as well, and so far the 'great Crockford hope' isn't doing the trick.
I think the test we used is pretty definitive:
startTime = new Date().getTime();
dataSet = JSON.parse(dataSet);
endTime = new Date().getTime();
trt = endTime - startTime;We're getting much better results on an M1 (7mb of data parsed in 2.5 minutes)
vs an intel Mac (same 7mb of data parsed in 12 minutes)
(That Mac is on the east coast, so maybe we can blame that 🤪)
Have you tested parsing a 7mb dataset in ExtendScript and seen it handle it at more-or-less browser JS speed?
Copy link to clipboard
Copied
> Have you tested parsing a 7mb dataset in ExtendScript and seen it handle it at more-or-less browser JS speed?
I've never attempted that, and have no reason to doubt your results.
I presume you're running your ExtendScript from within a CEP panel(?); perhaps you could do the JSON processing via JavaScript (in CEP), rather than in ExtendScript?
Copy link to clipboard
Copied
I presume you're running your ExtendScript from within a CEP panel(?)
Yes
perhaps you could do the JSON processing via JavaScript (in CEP), rather than in ExtendScript?
We actually pare down the data on the JS side to send a minimal amount to ExtendScript.
Any idea why ExtendScript should have trouble with a JSON.parse?
I might try an approach that doesn't require JSON.parse as alternate or otherwise get creative with how the data is sent.
(Maybe this is a good time to re-ask if UXP by chance is coming to Premiere?)
Copy link to clipboard
Copied
>Any idea why ExtendScript should have trouble with a JSON.parse?
None, sorry.
> Maybe this is a good time to re-ask if UXP by chance is coming to Premiere?
Yes! We are currently working on providing support for PPro extensibility via UXP. No dates available.
Copy link to clipboard
Copied
Need any beta testers?
Copy link to clipboard
Copied
Once 3rd party UXP extensibility is available in PPro beta builds, we will definitely want lots of testers. Don't worry, we'll announce that availability, loudly and broadly. 🙂
Copy link to clipboard
Copied
Looking forward to it!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more