RFR: 8042778: Getting all visible methods in ReferenceTypeImpl is slow
Jeremy Manson
jeremymanson at google.com
Fri May 9 16:32:42 UTC 2014
Hi David,
Hm. This was done several years ago in response to a user request, and he
claimed it cleared up the problem, but you're right - contains() on the
collection returned by map.values() should have been an O(1) operation,
both then and now. So I'll check into it and get back on this next week.
Jeremy
On Thu, May 8, 2014 at 8:17 PM, David Holmes <david.holmes at oracle.com>wrote:
> Hi Jeremy,
>
>
> On 9/05/2014 4:56 AM, Jeremy Manson wrote:
>
>> I'm testing out my newly acquired OpenJDK authorship with something
>> simple. If I did this wrong, I apologize.
>>
>> Basically, the debugger becomes very slow if there are a lot of methods
>> in a class. This can happen (O(thousands)) if you are using a code
>> generation tool.
>>
>> http://cr.openjdk.java.net/~jmanson/8042778/webrev.00/
>>
>
> I find it counter-intuitive that this makes things faster:
>
> - list.retainAll(map.values());
> + list.retainAll(new HashSet<Method>(map.values()));
>
> Can you explain why introducing the intermediate HashSet improves things?
> A comment in the code would also be good.
>
> Thanks,
> David
>
>
>
>
> Reviews from reviewers and committing from committers would be
>> appreciated. Thanks!
>>
>> Jeremy
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20140509/6d9f1547/attachment.html>
More information about the serviceability-dev
mailing list