Skip to content

Early startup phase optimizations#9308

Open
mbien wants to merge 3 commits intoapache:masterfrom
mbien:startup-misc-perf
Open

Early startup phase optimizations#9308
mbien wants to merge 3 commits intoapache:masterfrom
mbien:startup-misc-perf

Conversation

@mbien
Copy link
Copy Markdown
Member

@mbien mbien commented Mar 29, 2026

This is the third PR after #9303 and #9307 which improves various other startup bottlenecks which showed up during startup profiling. With all three applied, Main#start finishes in about 2400 ms on my system now. todo: add reference value

split into 3 commits:

InstalledFileLocatorImpl: avoid recompiling regex in hot code

  • clusterFor() is called often during startup and flamegraph showed that the regex pattern as bottleneck.
    -> implement the dynamic part of the regex by hand so that the constant part can be put in a static field.

NbInstaller hidden pkg and deprecated module computation optimizations

  • move string.split(regex) into pattern and out of inner loop reverted, wasn't worth it in this particular case
  • avoid loading all (~700) modules into TreeMap for the purpose of sorting warning lines which may or may not occur
  • use 0 copy Module#getDependenciesArray for iteration instead of copied Set
  • code renovations

Startup logger info dump optimization

  • remove reflective JDK module info query code
  • print standard ISO date/time to avoid date formatter bootstrap (this alone was almost 50ms)
    misc:
  • removed a test cases testing ThreadDeath as part of the cleanup

before:
image

after:
image

marked in purple from left to right: TopLogging#printSystemInfo, ModuleList#findJarByName and NbInstaller#checkForDeprecations

@mbien mbien added this to the NB30 milestone Mar 29, 2026
@mbien mbien added Code cleanup Label for cleanup done on the Netbeans IDE performance Platform [ci] enable platform tests (platform/*) ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Mar 29, 2026
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Mar 29, 2026

i think I added a section to the wrong PR. Will fix the test.

@mbien mbien force-pushed the startup-misc-perf branch from 09e40fd to 706d25c Compare March 29, 2026 16:14
clusterFor() is called often during startup and flamegraph showed that
the regex pattern as bottleneck.

-> implement the dynamic part of the regex by hand so that the constant
part can be put in a static field.
@mbien mbien force-pushed the startup-misc-perf branch from 706d25c to a212d66 Compare March 29, 2026 22:03
mbien added 2 commits March 30, 2026 00:26
 - avoid loading all (~700) modules into TreeMap
 - use 0 copy Module#getDependenciesArray for iteration instead of Set
 - code renovations
 - remove reflective JDK module info query code
 - print standard ISO date/time to avoid date formatter bootstrap

misc:

 - removed a test cases testing ThreadDeath as part of the cleanup
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Apr 3, 2026

delay review requests please. Wrong PR :) cache loading PR has to go in first.

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

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Code cleanup Label for cleanup done on the Netbeans IDE performance Platform [ci] enable platform tests (platform/*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant