Why are javascripts so slow in Illustrator?
I have now written over 15 javascripts for Illustrator and have found that if it is a lot of looping commands again, it is very slow. The script is available below to copy and try.
Executing a command by looping 2500 takes in ...
... Illustrator 4.1 seconds
... InDesign 4.7 seconds
... QuarkXPress 0.4 seconds
... Safari 0.1 seconds
QUESTION:
Is there anything that can be done for Adobe Illustrator and InDesign to increase the speed by a factor of 10?
The script:
const cDauer = 500;
var vText = "";
var vLength = 0;
var vStart = new Date().getTime();
for (var i = 0; i < cDauer; i++) {
for (var j = 0; j < cDauer; j++) {
vText = vText + "a";
vLenght = vText.length;
} }
var vEnde = new Date().getTime();
alert ("End. Duration = " + (vEnde - vStart)/1000 + " Seconds.");
/* cDauer = 500 */
/* Javascript (.js) in AI = 4.124 Sekunden. */
/* Javascript (.jsx) in AI = 4.258 Sekunden. */
/* Javascript (.js) in IND = 4.766 Sekunden. */
/* Javascript (.jsx) in IND = 4.62 Sekunden. */
/* Javascript (.js) in QXP = 0.04 Sekunden. */
/* cDauer = 2000 */
/* HTML in 0.295 Sekunden.
/* LiveCode 9.6 interpreter in 0.124 */
/* LiveCode 9.6 compiler in 0.126 */
