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

Claes Redestad claes.redestad at oracle.com
Sun Nov 10 21:58:39 UTC 2019


Hi Ivan,

unless I'm gravely mistaken, ResourceObjs like 'buffer' does not need to
explicitly freed as long as it's allocated within a ResourceMark scope.

/Claes

On 2019-11-10 11:26, Ivan Gerasimov wrote:
> Hi Claes!
> 
> I see that 'buffer' is never deleted in create_defaults_and_exceptions().
> 
> With kind regards,
> 
> Ivan
> 
> On 11/8/19 3:57 AM, Claes Redestad wrote:
>> 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