RFR: 8233497: Optimize default method generation by data structure reuse

Claes Redestad claes.redestad at oracle.com
Fri Nov 8 11:57:56 UTC 2019


Hi,

when loading classes with complex hierarchies and many default methods,
we can end up spending significant time in
DefaultMethods::generate_default_methods

This optimization reduces work done and memory requirements by reusing
allocated data structures. For example by maintaining free lists of
allocated Node objects.

Bug:    https://bugs.openjdk.java.net/browse/JDK-8233497
Webrev: http://cr.openjdk.java.net/~redestad/8233497/open.00/

Testing: Tier1-3, will make sure tier4-7 pass before push

Performance notes: On one of our more complex startup tests we see a 3%
improvement on the execution time total. Much less on simpler
applications.

I've not done a formal complexity analysis, but I think the memory
complexity is now down from O(N*M) to O(N+M) where N is the number of
classes and interfaces in the hierarchy and M the number of methods of
interest in that hierarchy. Algorithmic complexity is probably O(N*M)
still, but with much better constants.

Special thanks to Lois for patience and persistence over several rounds
of pre-review!

Thanks!

/Claes


More information about the hotspot-runtime-dev mailing list