Re: org.objectweb.asm.tree.analysis.Frame
Rémi Forax <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
Le 22/07/2010 01:07, Eugene Kuleshov a écrit :
> Eric, Remi,
>
> I wonder if you have spare cycles to look at few things in
> org.objectweb.asm.tree.analysis.Frame class and run some performance
> tests with it.
>
> First of all it is using a reversed for loop, which in my knowledge
> is not very HotSpot friendly [1] and it is better to use a direct loop
> instead, e.g.
>
> for (int i = Type.getArgumentTypes(desc).length; i > 0;
> --i) {
> values.add(0, pop());
> }
>
Reverse loop was performing better than direct one with first releases
of hotspot,
It's no more true. Now performance seems equivalent.
But reverse loop also avoid to use two registers instead of one
(you need a local variable to store the length).
int length == ...
for(int i=0; i< length; i++) { ... }
For loooong method, it reduce register pressure which is a good idea.
So I'm not sure it worth investigation.
> Another thin I noticed is that it is using an ArrayList and inserting
> at the beginning, as in the above code snippet. So, it might be better
> to use LinkedList instead.
It can be a big O problem but given that Java method have usually a
small number of
argument. A serious benchmark is needed here.
>
> The reversed for loop is also used in few other places, including
> some core API and I wonder if we can squeeze some performance out
> there too.
>
> regards,
> Eugene
>
> [1] http://wikis.sun.com/display/HotSpotInternals/PerformanceTechniques
>
>
I have not a lot of free cycles. At least until the JVM Summit next week :)
After, I think I prefer to work on how to add JSR 292 missing pieces,
(invokedynamic/bootstrap method and new constant pool constants).
Rémi
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws