Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Startup performance with devtools #85

Closed
dsyer opened this issue Dec 6, 2016 · 14 comments
Closed

Startup performance with devtools #85

dsyer opened this issue Dec 6, 2016 · 14 comments
Labels

Comments

@dsyer
Copy link

dsyer commented Dec 6, 2016

There might be some things we can do to improve startup times:

  • -XX:TieredStopAtLevel=1 has a big effect
  • -noverify also is appreciable
  • Run the main method, not the jar launcher (if we don't already)

Devtools restarts are already pretty fast, but the initial launch could be quicker. There are also some tricks you can play with -Xshare:on to use pre-parsed class data cached on disk. There might be other things (@aclement is a font of ideas).

See spring-projects/spring-boot#7493 for some discussion and benchmarks (also https://github.com/dsyer/spring-boot-startup-bench).

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Andy Clement:)

Not sure this should be squeezed into 3.8.3 - need to think it through more. Xshare requires turning on JVM for commercial use and I don't think we want to 'just do that' under the covers.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Martin Lippert:)

Maybe we could add the low-hanging and low-risk changes to the 3.8.3 release and look at the more complicated ones (-Xshare) for 3.8.4.
Low hanging candidates:
-noverify
-XX:TieredStopAtLevel=1

@dsyer
Copy link
Author

dsyer commented Dec 15, 2016

Those low hanging ones are pretty easy for users to do themselves, but if we do it, they will have a better experience without knowing the details. So that sounds like a good first step.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Andy Clement:)

The only downside is that they do have an impact and the user won't be aware of the choice that is being made for them.

-noverify is probably fine. (do we start STS with noverify to speed it up - can't recall if we added that but I know we had an item for it somewhere).

-XX:TieredStopAtLevel=1 - is saying "I want it to start fast, in return I don't mind if it isn't going at maximum speed later because I'm not going to be running this for long".

I guess I'm thinking of a little transparency, first launch ask them the question if they want to use it and briefly indicate the trade offs, then persist that decision.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Andy Clement:)

Per my last comment. I think those are the two to run with. But I don't want to do them silently, the developer should be able to opt-in the first time they do something that might benefit from them. (together with a dont-ask-me-again option). For someone who answers no/dont-ask-me-again to whatever we initially ask a small checkbox or something to do it in the launch config box might be nice.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Kris De Volder:)

The two options -noverify and -XX:TieredStopAtLevel=1 seems independent from devtools. So we could add them on any launch without checking if they have devtools as a dependency... correct?

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Andy Clement:)

Yes they are independent.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Alex Boyko:)

Are we adding this to Boot launch? I'm thinking about looking into implementing it...

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Martin Lippert:)

I think we can add this, but should offer a clear preference page for it. That preferences page would allow the user to disable this "automatic addition to JVM options" and would allow the user the specify those automatic JVM options (with "Restore Defaults" to get back to our preferred settings).

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Alex Boyko:)

I'm thinking of adding a checkbox "Fast startup" on the Boot launch wizard main tab. If user checks it I think it'd be good to show a message box explaining pros vs cons of this option being on and put a checkbox on the message not to show it again. The setting for showing this message would be kept in the preferences. Also the default value for "Fast startup" (boolean) will be kept in the preferences. Default value would be applied for a newly created boot launch config. Preference page for these 2 values would be the Spring -> Boot page for example. Or Spring -> Boot -> Launch? A dedicated new preference page?
How do these requirements sound to you all?

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Martin Lippert:)

Sounds good to me. I would prefer to use the general Spring -> Bootpreference page for that instead of a new one.
I would also prefer to have an editable text field that shows exactly what is being added as JVM options, so that users can change that, if they want to. This could be useful, for example, if people choose to remove one specific setting, but want to keep the others.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Alex Boyko:)

@mlippert do you see people having "Fast Startup" on by default when new boot launch config is created? I have it as a preference but as I more think about it it feels that it may not be a good default. What do you think?

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Martin Lippert:)

Not exactly sure what you mean, but I think the "fast startup" should be ON by default. Otherwise I doubt that many people will go into the preferences and enable it. I think we should be convinced that the options that we put in by default are good ones that do not cause any harm. Therefore the default should be ON.

@spring-projects-issues
Copy link

(comment in Pivotal Tracker added by Alex Boyko:)

I have pushed my changes for this story. Think it covers all requirements mentioned above, so I'll mark it delivered for now... will see if it's indeed everything we wanted during the meeting tomorrow

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants