• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

The execution time is very different when executing Javascript from File -> Scripts and app.doJavasc

New Here ,
Aug 16, 2020 Aug 16, 2020

Copy link to clipboard

Copied

When you select a file from the File -> Scripts menu and run it, it runs very quickly, and there is no slowdown in running it several times in succession.
However, if you run it using app.doJavascript in VBA or run the script in CEP, it runs quickly as soon as the application is first started, but the speed continues to slow down every successive run.
I am trying to show the information of the illustrator document contents in CEP or external application, but I cannot use it because of the slower speed each time I run it. Using $.gc() didn't change anything.
Both show the same behavior in 2020 and 2019 versions. I wanted to test the previous versions as well, but they are not on the Adobe Creative Cloud installable list.
I am trying to create a CEP or an external application that shows detailed information of an illustrator document, but there is a problem because the consistent speed is not available. What is the solution?

 

 

 

TOPICS
Bug , Performance , Scripting , SDK

Views

407

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Aug 17, 2020 Aug 17, 2020

Could it be related to this. Looks like there are some performance issues with scripting. https://community.adobe.com/t5/illustrator/script-takes-longer-and-longer-when-accessing-individual-pathpoint-objects/m-p/10917358?page=1

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 16, 2020 Aug 16, 2020

Copy link to clipboard

Copied

Hi, I'm not an expert at this, and your code looks fine to me, but if you have time to experiment, it might help to try structuring your script as a Self Invoking FunctionThis answer gives a quick overview.

 

The idea is to tidy up the scope of the variables, so there shouldn't be anything left in memory after the function has been executed. The second execution should leave memory as pristine as the first. Well, that's the theory.

 

EDIT: I was curious, so I just tried structuring your code as a self-invoking function and it didn't help. Each run gets slower, as you report. Curious! I'll wait for an answer, too. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2020 Aug 16, 2020

Copy link to clipboard

Copied

I just modified and tested it, but nothing changed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2020 Aug 16, 2020

Copy link to clipboard

Copied

Yeah, that's what I found too. I also tried it all wrapped in an object and that didn't help either. I'm really curious!

It seems to be getting slower linearly, but I haven't graphed the times. Closing and reopening the document doesn't help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 17, 2020 Aug 17, 2020

Copy link to clipboard

Copied

Could it be related to this. Looks like there are some performance issues with scripting. https://community.adobe.com/t5/illustrator/script-takes-longer-and-longer-when-accessing-individual-...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2020 Aug 17, 2020

Copy link to clipboard

Copied

LATEST

Yes! Thank you MilosR.

 

kyoung_namk48754987, please look at the difference between the OPs script and CarlosCantos' below. Amazing difference in performance!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines