elk icon indicating copy to clipboard operation
elk copied to clipboard

Slow down of first context menu due to ELK loading services

Open Bananeweizen opened this issue 1 year ago • 0 comments

Describe the bug Opening the first context menu in the package explorer/navigator of an application containing ELK leads to a notable delay before the menu becomes visible. ELK causes half a second of delay by loading layout services when it's property tester is used the first time:

grafik

Expected behavior Bundle activators should do as little work as possible, as bundle activation can be triggered by UI interaction and will then slow down everything happening on the UI thread.

ELK Version 0.9.0

Additional context Looking at the relevant method at https://github.com/eclipse/elk/blob/f53099f7fee46735a88c0b4d67fcdf943a0179f2/plugins/org.eclipse.elk.core.service/src/org/eclipse/elk/core/service/ElkServicePlugin.java#L136 it seems like all of that could be executed inside of LayoutMetadataService.getInstance() instead, which would defer the code until it's needed, and the plugin activation would be fast again.

Bananeweizen avatar Apr 09 '24 09:04 Bananeweizen