Skip to main content
Sturm359
Inspiring
November 8, 2018
Answered

Code review: Slow to start

  • November 8, 2018
  • 1 reply
  • 2614 views

I have an Adobe CEP project for Illustrator CC 2018-2019 that I've finished, more or less. I plan on distributing it through the art department of our company only. However, one problem that my beta tester (read: guinea pig) has noted is that it is slow to start. That is, it takes a significantly long period of time between the time that the panel appears and the blank gray area is filled with the HTML content.

Normally, I'd say that this behavior is indicative of too many libraries being loaded up in the header. However, since this is a completely local project (no CDN references) and there are only a few small CSS files loading in the header, I honestly don't know why it takes a good 30+ seconds for the panel to completely load.

Can anyone please help me to identify where the problem lies or is this just normal for CEP panels? You can clone my repo of the project from Github. Also, I have the packaged ZXP of it, if there's a way I can post it here for testing. (Although I guess you wouldn't be able to see the source code in it.)

Thank you.

This topic has been closed for replies.
Correct answer Trevor:

See Setting Cep Debug Mode and Log Level the Easy Way | Creative-Scripts.com

If the flag is set to 1 then it should go a lot quicker, the node modules will really slow things down.

You can try use https://rollupjs.org/guide/en  to reduce the amount of files you are using and then the startup time can be greatly reduced.


Just to clarify a bit what's happening.

Adobe wants to provide some security protection for both the users and developers. They do this hashing all the files. For example if we have a file x.js whose contents is "abc" some calculation will be applied to the contents to produce some code unique to that file like 123 that process can be quite quick but is the contents is somewhat longer and if there are 13,000 files to process then it's going to really long time. If in any of those file any change is made then the hash won't match the files and we know the extension has been fiddled with, so it won't load.

Developer need to be able to work with non signed extensions otherwise the development process would take ages.

So one can set a debug flag that will disable the hash checks and allow for fiddled unsigned extensions to run. This will allow the extensions to start up much quicker.

If the extension is internal, i.e. for your own org then you can disable the check, if it's external then you have to minimize the code.

There are different ways of installing node modules with huge differences in the amount of files but even the reduced one will contain loads of code which is not needed so for the distribution version of the extension you can roll up the code.

The rollup will remove any files that are not need and combine the needed ones into 1 file that only contains the functions required for the code to work.

In short it could be you can reduce those 13000 files into a handful of files and that's going to make the hash time insignificant.

1 reply

Ten A
Community Expert
Community Expert
November 12, 2018

I think your project not so heavy.

If you using timestamping, an extension communicates with a timestamp server to validates timestamping when startup it.

Probably, In your cases, validation processing over the network takes time for some reasons.

Sturm359
Sturm359Author
Inspiring
November 12, 2018

Hi, Ten, thanks for replying.

The project does not use any timestamping of which I am aware. Even if it did, shouldn't the HTML "page" be rendered in the panel before any scripting is done? All of the scripts are at the end of the <body> element for exactly this reason. There shouldn't be any processing over the networking before the scripts are called, right?

Trevor:
Legend
November 12, 2018

Have the client time the load time with the debug flag set to true.

If it loads quickly then the problem is hashing the files.

There is what to do about that but see if that is the problem