eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

Optimize StackTraceElement generation #7776

Open DanHeidinga opened 4 years ago

DanHeidinga commented 4 years ago

We've been doing some work to optimize stacktraces. OpenJ9 currently generates stacktraces using two passes:

The current focus is on optimizing the Pass 2 part.

Work so far:

Future areas:

Areas to circular back to once the above is complete:

Rejected approaches:

DanHeidinga commented 4 years ago

@fjeremic If this is missing anything, feel free to edit & add any links / descriptions / etc

fjeremic commented 4 years ago

@fjeremic If this is missing anything, feel free to edit & add any links / descriptions / etc

Excellent summary this far. Thank you for putting this together. I've added another future area for a caching prototype I have which I suspect will be subject to debate on the PR once it is opened. I expect to have something in PR form by early next week I hope. My current focus is on cleaning up #7765 to get that in a deliverable state.

zl-wang commented 4 years ago

A wild secondary idea (for general string interning) to consider alleviating the StringTable lock: two staged StringTable --- one table is read-only accumulating newly interned strings only during GC (for example); another table needing lock to accumulate during mutators running. The stable state doesn't need lock. One table structure overhead ...

DanHeidinga commented 4 years ago

We should be applying the same optimizations to the JDK11 StackWalker api as well - see https://github.com/eclipse/openj9/blob/1dd14da6ca1351c8ab42f40b0c7e324c39ab102e/runtime/jcl/common/java_lang_StackWalker.cpp#L139

DanHeidinga commented 4 years ago

Links to the interning of method names in other areas: