EditorComponent Optimization

Post here questions and problems related to oXygen frameworks/document types.
Johann
Posts: 198
Joined: Wed Jun 17, 2015 12:46 pm

EditorComponent Optimization

Post by Johann »

Hi everyone,

I am using Oxygen SDK (version 18). My application contains tabs and each tab is an EditorComponentProvider. The first tab takes a long time to open then the following tabs are faster to open.
I tried to make some tests in the AuthorComponentSample and I noticed that the first call of factory.createEditorComponentProvider(...) is very slower than the following ones.
In the same way, the first call of editorComponent.load(...) is slower than the following ones. (with the same document)

Am I right on that behavior ?

How can I optimize the first opening to be as faster as the following ones ?

Thanks for your help,

Johann
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: EditorComponent Optimization

Post by Radu »

Hi Johann,

Are all the component JAR libraries on the local drive or is it started using JavaWebstart?
It's expectable that on the first opened tab there is a longer delay (as all the classes are loaded) but there should be not such a long delay.
By "long time" what do you mean? How many seconds?
You should check if the component tries to access any web resource, maybe use a sniffer for this. If it does, usually it goes after some schema which is associated to the XML so using an XML catalog to resolve the schema reference on disk will fix this problem.
Also in such cases we usually use the JProfiler application to see where the delay occurs. Maybe you could try the same.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Johann
Posts: 198
Joined: Wed Jun 17, 2015 12:46 pm

Re: EditorComponent Optimization

Post by Johann »

Hi Radu,

The JAR libraries are on the local dirve.
In fact, I know that when I load a document which requires some webresources it can take a longer delay the first time to put these resources in a cache.
But, without loading a document, without framework, the call of factory.createEditorComponentProvider(...) takes about 2~3 seconds the first time and then only a few ms for the following calls. The users clearly feel this difference when they open several tabs on the application.

So, maybe, have I to preload the classes ?

I will try to optimize the document loading by checking web resources loaded and using some profilers.

Regards,

Johann
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: EditorComponent Optimization

Post by Radu »

Hi Johann,

2-3 seconds for the first call to the method which creates the component is expectable and indeed is probably connected to class loading.
So maybe indeed you could try to issue a call to the method right after calling the factory.init() method to force load all classes.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply