Improving startup time of an MPS-based RCP by avoiding watching jars

Hello,

I am investigating the slow startup of an RCP application built with MPS. After enabling log traces, I have noticed that MPS is "watching" all .jars from the MPS RCP directory. Basically, my log contains 700+ messages like this:

>>>

2018-09-18 06:57:14,113 [  24605]  DEBUG - jetbrains.mps.ide.platform.watching.WatchedRoots - Adding watch request for the path D:/rcp/plugins/http-support/solutions/jetbrains.mps.ide.httpsupport.runtime-src.jar  

<<<

Each operation to attach a watch is quite expensive. I have "slightly" modified WatchedRoots.java and added a guard which prevents watching if my path is a jar file (code snippet below).

The startup improvement is very big and it seems to me that my RCP works functionally as expected.

Would this be a valid fix? Under which conditions can we assume that no watching of Jars is needed?, or, is watching of jars needed at all?

Thank you!

With best regards,

Dan

 

public synchronized boolean addWatchRequest(@NotNull String path) {
// my fix
if (path.endsWith(".jar")) return false;
ApplicationManager.getApplication().assertReadAccessAllowed();

 

4

Please sign in to leave a comment.