Re: Re: Re: [Findbugs-core] toward ASM 4.0?

[email protected]
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <926353025.9132731314088409304.JavaMail.root@zimbra7-e1.priv.proxad.net>
Brian Goetz wrote:
> > as I said previously, the code ensuring backward comptability will
> > only add a cost for old code. Up to date code will run as fast as
> > with the current API (or even faster since invokevirtual may be
> > faster than invokeinterface).
> 
> You might be right, 

attached are the results I get with the code I sent in my previous email. It is difficult to compare things because the results are quite different from one execution to the next, and the hotspot optimizer is not always triggered at the same point. However, globally, I would say that the performance is the same with interfaces or with abstract classes.

> but I don't think you don't have remotely enough 
> data to back up this performance assertion.  Taking what is now a
> simple 
> code path which might inline easily, and turning it into a complicated
> code path with lots of conditional logic and where some of the "dead"
> conditional branches point off into native code (e.g., reflection),
> may 
> very well change the inlining and other optimization characteristics.

for up to date code generators, I don't need "remotely enough data" to be sure that the impact will be null, because this code will directly call the most recent methods in ClassWriter, MethodWriter, etc, which will not contain any redirecting code (this code will be in the older versions of these methods).

for up to date code analyzers or transformers, there are two cases: if an API method is overriden by the user, I'm sure here again that the impact on performance will be null, because the user code will be called directly, bypassing the potentially complex default implementation in ASM. If this user code calls the ASM code via super.visitXxx(...), or if the user does not override some ASM provided method, I'm pretty sure the impact of the compatibility checking cost will be constant and very small, because it will always have the following form (see my code examples in previous emails):

// ASM code for the most recent signature of an API method
void visitXxx(...) {
    if (version < most recent version) {
        // potential complex and costly code, 
        // but path not taken by up to date 
        // visitors
    } else {
        if (next != null) next.visitXxx(...);
    }
}

in other words, the only added cost is the version checking conditionnal. And we can measure it right now (I don't think that the content of the "if" branch can have an impact for code that never takes this branch).
 
> Again, I think this is an awful lot to consider between an RC release 
> and a final release.  RC releases are supposed to mean "unless we find
> serious problems with new functionality, it's ready to go."

ok, here is what I propose:
- we create a branch in the SVN from the revision just before the package renaming, and we reapply the changes after this renaming into the branch
- we tag this branch ASM 4.0 and we release it this week. We say explicitely that this version will *not* be maintained, i.e. there will be no 4.x version
- we continue the development in the trunk, applying the change from interfaces to abstract classes, and we release an ASM 5.0 beta in one or two weeks with these changes. The "beta" will indicate that the "commons", "util" and "xml" APIs may still change (but the "asm" and "tree" ones will not).

Eric
interfaces.txt (text/plain, 3.3 KB)
     [java] Starting get class info test.
     [java] - to get class info 24611 classes = 109 ms.
     [java] - to get class info 24611 classes = 62 ms.
     [java] - to get class info 24611 classes = 47 ms.
     [java] - to get class info 24611 classes = 47 ms.
     [java] - to get class info 24611 classes = 31 ms.
     [java] Time to get class info 123055 classes = 296 ms.
     [java] Processing rate = 415726 classes per sec (1279439 kB per sec).
     [java]
     [java] Starting deserialize test.
     [java] - to deserialize 24611 classes = 702 ms.
     [java] - to deserialize 24611 classes = 717 ms.
     [java] - to deserialize 24611 classes = 733 ms.
     [java] - to deserialize 24611 classes = 749 ms.
     [java] - to deserialize 24611 classes = 733 ms.
     [java] Time to deserialize 123055 classes = 3634 ms.
     [java] Processing rate = 33862 classes per sec (104214 kB per sec).
     [java]
     [java] Starting deserialize with tree package test.
     [java] - to deserialize 4922 classes with tree package = 1014 ms.
     [java] - to deserialize 4922 classes with tree package = 749 ms.
     [java] - to deserialize 4922 classes with tree package = 748 ms.
     [java] - to deserialize 4922 classes with tree package = 656 ms.
     [java] - to deserialize 4922 classes with tree package = 592 ms.
     [java] Time to deserialize 24610 classes with tree package = 3759 ms.
     [java] Processing rate = 6546 classes per sec (20149 kB per sec).
     [java]
     [java]
     [java] Starting deserialize and reserialize test.
     [java] - to deserialize and reserialize 24611 classes = 1638 ms.
     [java] - to deserialize and reserialize 24611 classes = 1575 ms.
     [java] - to deserialize and reserialize 24611 classes = 1638 ms.
     [java] - to deserialize and reserialize 24611 classes = 1607 ms.
     [java] - to deserialize and reserialize 24611 classes = 1591 ms.
     [java] Time to deserialize and reserialize 123055 classes = 8049 ms.
     [java] Processing rate = 15288 classes per sec (47051 kB per sec).
     [java]
     [java] Starting deserialize and reserialize with copyPool test.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 982 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 578 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 561 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 577 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 578 ms.
     [java] Time to deserialize and reserialize 123055 classes with copyPool = 3276 ms.
     [java] Processing rate = 37562 classes per sec (115602 kB per sec).
     [java]
     [java] Starting deserialize and reserialize with tree package test.
     [java] - to deserialize and reserialize 4922 classes with tree package = 405 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 375 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 390 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 390 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 390 ms.
     [java] Time to deserialize and reserialize 24610 classes with tree package = 1950 ms.
     [java] Processing rate = 12620 classes per sec (38842 kB per sec).
abstractclasses.txt (text/plain, 3.3 KB)
     [java] Starting get class info test.
     [java] - to get class info 24611 classes = 93 ms.
     [java] - to get class info 24611 classes = 47 ms.
     [java] - to get class info 24611 classes = 62 ms.
     [java] - to get class info 24611 classes = 47 ms.
     [java] - to get class info 24611 classes = 47 ms.
     [java] Time to get class info 123055 classes = 296 ms.
     [java] Processing rate = 415726 classes per sec (1279439 kB per sec).
     [java]
     [java] Starting deserialize test.
     [java] - to deserialize 24611 classes = 718 ms.
     [java] - to deserialize 24611 classes = 748 ms.
     [java] - to deserialize 24611 classes = 734 ms.
     [java] - to deserialize 24611 classes = 748 ms.
     [java] - to deserialize 24611 classes = 749 ms.
     [java] Time to deserialize 123055 classes = 3697 ms.
     [java] Processing rate = 33285 classes per sec (102438 kB per sec).
     [java]
     [java] Starting deserialize with tree package test.
     [java] - to deserialize 4922 classes with tree package = 951 ms the longest took 62 ms (7892 bytes).
     [java] - to deserialize 4922 classes with tree package = 718 ms.
     [java] - to deserialize 4922 classes with tree package = 702 ms.
     [java] - to deserialize 4922 classes with tree package = 187 ms.
     [java] - to deserialize 4922 classes with tree package = 187 ms.
     [java] Time to deserialize 24610 classes with tree package = 2745 ms.
     [java] Processing rate = 8965 classes per sec (27592 kB per sec).
     [java]
     [java]
     [java] Starting deserialize and reserialize test.
     [java] - to deserialize and reserialize 24611 classes = 1778 ms.
     [java] - to deserialize and reserialize 24611 classes = 1529 ms.
     [java] - to deserialize and reserialize 24611 classes = 1560 ms.
     [java] - to deserialize and reserialize 24611 classes = 1560 ms.
     [java] - to deserialize and reserialize 24611 classes = 1591 ms.
     [java] Time to deserialize and reserialize 123055 classes = 8018 ms.
     [java] Processing rate = 15347 classes per sec (47233 kB per sec).
     [java]
     [java] Starting deserialize and reserialize with copyPool test.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 1389 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 686 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 593 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 562 ms.
     [java] - to deserialize and reserialize 24611 classes with copyPool = 561 ms.
     [java] Time to deserialize and reserialize 123055 classes with copyPool = 3791 ms.
     [java] Processing rate = 32459 classes per sec (99898 kB per sec).
     [java]
     [java] Starting deserialize and reserialize with tree package test.
     [java] - to deserialize and reserialize 4922 classes with tree package = 406 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 374 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 390 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 390 ms.
     [java] - to deserialize and reserialize 4922 classes with tree package = 375 ms.
     [java] Time to deserialize and reserialize 24610 classes with tree package = 1935 ms.
     [java] Processing rate = 12718 classes per sec (39143 kB per sec).
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.