Several optimizations of Embedded GF startup#26033
Open
OndroMih wants to merge 4 commits into
Open
Conversation
Reduces startup time by about 300ms, from 2.2s to 2.0s, about 10% Things done: - set multiple properties in a single command (not so significant but might help) - preload some work in background ASAP - load some non-essential things in background (unpacking RARs to the domain) - do not initialize alias store if it's not needed
Pass the context classloader to the asynchronous jobs. Without this, the service loader doesn't find some classes when Embedded GlassFish is started within the same JVM as Maven (using an old Maven plugin or the new plugin with execution configured to the same JVM)
25bb136 to
b74acda
Compare
pzygielo
reviewed
May 25, 2026
| /* | ||
| Unpacks the domain directory and sets up the properties related to the environment | ||
|
|
||
| Asynchronously completes tasks that aren't essential during startup to move them from the main thread. |
Contributor
There was a problem hiding this comment.
At first glance I fail to see where is this async hidden here. Isn't fully completed Future returned from here? And everything happens in the same Thread that calls setEnv? I think thenRun, unlike thenRunAsync also runs in the same Thread that given Future is being computed in.
🤔
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduces startup time by about 300ms, from 2.2s to 2.0s, about 10%
Things done: