New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve jar start up time #123

Open
dylan-chong opened this Issue May 19, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@dylan-chong

dylan-chong commented May 19, 2018

> time plantuml nonexistentfile

real    0m5.827s
user    0m2.131s
sys     0m0.464s

The start-up time is ridiculously long. The example below shows how long it takes before Plant UML realises that the given file argument doesn't actually exist.

Six seconds to do nothing is far too long! This is definitely a problem for plug-ins such as the one mentioned in my comment here because it takes an additional six seconds to export the file.

It would be awesome if the load time could be greatly reduced.

@dylan-chong

This comment has been minimized.

dylan-chong commented May 19, 2018

The most significant slow part is this https://github.com/dylan-chong/plantuml/blob/test/slow-loading/src/net/sourceforge/plantuml/Run.java#L215

As can be seen in my benchmarking results when given an argument which is a nonexistent file (see the code in the link above):

1 options           : 1102 ms
  2.1 buff          : 0 ms
  2.2 graphics      : 0 ms
  2.5 fontmet       : 4324 ms
  2.6 rect          : 4 ms
2 force open jdk    : 4329 ms
3 do running        : 16 ms

When given a simple file as an argument , these are the results (total time 10s):

1 options           : 1241 ms
  2.1 buff          : 0 ms
  2.2 graphics      : 0 ms
  2.5 fontmet       : 6307 ms
  2.6 rect          : 11 ms
2 force open jdk    : 6321 ms
3 do running        : 2454 ms

And been given a simple file as an argument with the forceOpenJdkResourceLoad() line commented out (total time 6.7s):

1 options           : 900 ms
2 force open jdk    : 0 ms
3 do running        : 5774 ms

I'm just messing around the benchmarks i have no idea what i am doing.

Why is the forceOpenJdkResourceLoad() call required? It seems to be slowing down the export

@arnaudroques

This comment has been minimized.

Contributor

arnaudroques commented May 19, 2018

Some users had some issues running PlantUML with OpenJDK (process was hanging).
We figure out that on OpenJDK we have to force some resource initilization to let the process run normally. I have no idea why OpenJDK need this...
On our Oracle JVM, forceOpenJdkResourceLoad() was running without issues.

BTW, which Java JVM are you using ? It looks like you are using a Oracle JVM.
Could you post here the result of:

@startuml
version
@enduml

What we can do, is to test in the Java code which JVM is used and call forceOpenJdkResourceLoad() only is the underlaying JVM is OpenJDK.

@dylan-chong

This comment has been minimized.

dylan-chong commented May 20, 2018

@startuml
version
@enduml

screen shot 2018-05-20 at 1 03 30 pm

@arnaudroques

This comment has been minimized.

Contributor

arnaudroques commented May 21, 2018

Ok, thanks.
We've added this test in V1.2018.6

if (isOpenJdkRunning()) {

I'm still interested in your tests. I don't understand why option management is so long:
1 options : 1102 ms
Note that you can add -verbose flag at plantuml command line to have some more timing information.
Thanks for your feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment