Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to accelerate opening editors using DialectUIManager?(DialectUIManager)
How to accelerate opening editors using DialectUIManager? [message #1829031] Wed, 24 June 2020 08:10 Go to next message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 24
Registered: March 2020
Junior Member
Hi,

I am working on building an Eclipse RCP application with Sirius. Currently I ran into a performance problem: I need to open diagrams, tables, ... and other Sirius representations. I searched in the forum and found that I can use DialectUIManager to do that work.

The code snippet is:
DialectUIManager.INSTANCE.openEditor(mySession, myDiagram, 
myProgressMonitor);


The problem is that, I found that using this code snippet to open representation editors is extremely slow. I used JProfiler to analyze the application, and the openEditor method is just taking a lot of time. That's sort of annoying and brings a bad experience to my application.

So I wonder if there is any way to improve the performance of the DialectUIManager.openEditor method? Or is there any alternatives? Or why this method takes so much time?

Thanks so much for any help.
Re: How to accelerate opening editors using DialectUIManager? [message #1829038 is a reply to message #1829031] Wed, 24 June 2020 08:46 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 544
Registered: July 2009
Senior Member
Hi,

This is the normal entry point to open a representation. If it is slow in your context, the cause is not this method in particular. It really depends on what you consider "too slow", what is the size of your model, of your diagrams, the complexity of you odesign, etc.

You can try to disable the "Do refresh on representation opening" preference (in the main "Sirius" preference page). This will open your representations as fast as Sirius can, but with the risk that what you seen on screen in not in synch with the current state of your model.

Regards,
Pierre-Charles


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to accelerate opening editors using DialectUIManager? [message #1829051 is a reply to message #1829038] Wed, 24 June 2020 10:52 Go to previous messageGo to next message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 24
Registered: March 2020
Junior Member
It normally uses 2-3 second to open an editor every time I start my application, it's quite slow compared to other methods. Thanks for your advice and I'll try to optimize my model and representation design.
Re: How to accelerate opening editors using DialectUIManager? [message #1829058 is a reply to message #1829051] Wed, 24 June 2020 12:44 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 544
Registered: July 2009
Senior Member
Yufei Zhou wrote on Wed, 24 June 2020 12:52
It normally uses 2-3 second to open an editor every time I start my application, it's quite slow compared to other methods. Thanks for your advice and I'll try to optimize my model and representation design.


If the slowness is only the first few times you open a diagram right after application startup, it could be caused by lazy loading/initialization of Eclipse plug-ins, and/or JVM warmup.

You mention "compared to other methods": which other methods give faster results?


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to accelerate opening editors using DialectUIManager? [message #1829059 is a reply to message #1829051] Wed, 24 June 2020 12:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6874
Registered: July 2009
Senior Member
Hi

You need to distinguish between opening a first editor which will incur substantial JVM warm up overheads and opening a 100th editor by which time the JVM should have loaded all the classes and optimized the reptitious code.

Sirius is a big application so there is a lot to warm up. However you should check that you aren't warming up other applications too, particularly Xtext or UML or other Sirius editors that may not necessary at least for your initial view. You might also check that Forms/Property support is not loaded till needed.

If your Sirius editor is critical to your RCP user's experience you could arrange to load and optimize many relevant classes via earlyStartup. Not a recommended approach since all other usages are penalized by an optimization for one.

Regards

Ed Willink

Open your editor, then look at the configuration in Help About to see what has actually been started and compare it with a raw configuration before opening your editor.
Re: How to accelerate opening editors using DialectUIManager? [message #1829215 is a reply to message #1829058] Sun, 28 June 2020 10:52 Go to previous messageGo to next message
Yufei Zhou is currently offline Yufei ZhouFriend
Messages: 24
Registered: March 2020
Junior Member
Hi,

Thanks for your help. By mentioning "compared to other methods" that I mean my own rcp plugin codes, which doesn't rely on Sirius. So I think the problem is caused by Sirius's lazy-activation policy, and I'm trying to solve it by loading Sirius plugin when my rcp application starts.

But the problem is I cannot find how to load Sirius eagerly when the application starts. Would you please tell me how can I do that work? I think that will accelerate all the Sirius apis at the first startup and solves my problem.
Re: How to accelerate opening editors using DialectUIManager? [message #1829216 is a reply to message #1829215] Sun, 28 June 2020 12:32 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6874
Registered: July 2009
Senior Member
Hi

If you are really sure that you want all users to take the start up hit of early starting Sirius, just reference a class from each interesting Sirius plugin and invoke as InterestingSiriusClass.class.getName() or similar from your own early startup code.

If you have other users you might find that just starting a worker thread early which early starts one Sirius plugin per second in the background might be a compromise.

Regards

Ed Willink

[Updated on: Sun, 28 June 2020 19:33]

Report message to a moderator

Previous Topic:Synchronizing Sirius with Xtext
Next Topic:StateMachine - Transitions
Goto Forum:
  


Current Time: Sun Oct 25 03:16:35 GMT 2020

Powered by FUDForum. Page generated in 0.02079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top