[kaffe] 1.1.0 Interpreter Performance
Dalibor Topic
robilad@yahoo.com
Wed Jun 11 05:31:01 2003
Hi Kevin, hallo Helmer,
--- "Kevin D. Kissell" <kevink@mips.com> wrote:
> > > Our of curiousity, I configured the MIPS/Linux interpretive kaffe
> > > with --disable-debug, for speed, and ran the Embedded CaffeieneMark
> > > benchmark. Comparing the result with an equivalent 1.0.7-based build,
> > > we can see that a bunch of things have improved a little, some things
> > > have stayed the same, and that something has slowed down dramatically
> > > in string handling which more than cancells all the other improvements.
> > >
> > > [ test results skipped ]
> >
> > If you've got some time to waste, it'd be nice if you could
> > compare the performance of 1.0.7's System.arraycopy() with
> > the performance of 1.1.0's System.arraycopy() (nothing serious,
> > just create a huge array and measure how long it takes to
> > copy that array).
>
> Before going through the hassle of rebuilding/re-installing to
> try your experiment, I thought I'd look at the code. Jeez.
> No wonder. In 1.0.7, System.arraycopy() was a native
> method, defined in libraries/clib/native/System.c, which used
> the platform's memmov/memcpy functions. Now
> it's a Java implementation. Certainly easier to maintain
> that way, but it's unsurprising if it's more than 5 times slower.
Here are my results:
bash-2.05a$ java -version
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)
bash-2.05a$ java CaffeineMarkEmbeddedApp
Sieve score = 11584 (98)
Loop score = 76809 (2017)
Logic score = 66846 (0)
String score = 42014 (708)
Float score = 38244 (185)
Method score = 26566 (166650)
Overall score = 36935
bash-2.05a$ /tmp/topic/install-1. CaffeineMarkEmbeddedApp
install-1.0.7-i386-linux-jit3 install-1.1.0-i386-linux-jit3
bash-2.05a$ /tmp/topic/install-1.0.7-i386-linux-jit3/bin/kaffe -version
Kaffe Virtual Machine
Copyright (c) 1996-2002 Kaffe.org project contributors (please see
the source code for a full list of contributors). All rights reservced.
Portions Copyright (c) 1996-2002 Transvirtual Technologies, Inc.
The Kaffe virtual machine is free software, licensed under the terms of
the GNU General Public License. Kaffe.org is a an independent, free software
community project, not directly affiliated with Transvirtual Technologies,
Inc. Kaffe is a Trademark of Transvirtual Technologies, Inc. Kaffe comes
with ABSOLUTELY NO WARRANTY.
Engine: Just-in-time v3 Version: 1.0.7 Java Version: 1.1
bash-2.05a$ /tmp/topic/install-1.0.7-i386-linux-jit3/bin/kaffe
CaffeineMarkEmbeddedApp
Sieve score = 29624 (98)
Loop score = 86471 (2017)
Logic score = 46675 (0)
String score = 7079 (708)
Float score = 15077 (185)
Method score = 27304 (166650)
Overall score = 26526
bash-2.05a$ /tmp/topic/install-1.0.7-i386-linux-jit3/bin/kaffe
CaffeineMarkEmbeddedApp
Sieve score = 29146 (98)
Loop score = 86236 (2017)
Logic score = 46755 (0)
String score = 7068 (708)
Float score = 15366 (185)
Method score = 27154 (166650)
Overall score = 26503
bash-2.05a$ /tmp/topic/install-1.0.7-i386-linux-jit3/bin/kaffe
CaffeineMarkEmbeddedApp
Sieve score = 29546 (98)
Loop score = 86266 (2017)
Logic score = 46881 (0)
String score = 7064 (708)
Float score = 14690 (185)
Method score = 27308 (166650)
Overall score = 26400
bash-2.05a$ /tmp/topic/install-1.1.0-i386-linux-jit3/bin/kaffe -version
Kaffe Virtual Machine
Copyright (c) 1996-2002 Kaffe.org project contributors (please see
the source code for a full list of contributors). All rights reserved.
Portions Copyright (c) 1996-2002 Transvirtual Technologies, Inc.
The Kaffe virtual machine is free software, licensed under the terms of
the GNU General Public License. Kaffe.org is a an independent, free software
community project, not directly affiliated with Transvirtual Technologies,
Inc. Kaffe is a Trademark of Transvirtual Technologies, Inc. Kaffe comes
with ABSOLUTELY NO WARRANTY.
Engine: Just-in-time v3 Version: 1.1.0 Java Version: 1.1
bash-2.05a$ /tmp/topic/install-1.1.0-i386-linux-jit3/bin/kaffe
CaffeineMarkEmbeddedApp
Sieve score = 28946 (98)
Loop score = 85950 (2017)
Logic score = 46798 (0)
String score = 3036 (708)
Float score = 19290 (185)
Method score = 27877 (166650)
Overall score = 23978
bash-2.05a$ /tmp/topic/install-1.1.0-i386-linux-jit3/bin/kaffe
CaffeineMarkEmbeddedApp
Sieve score = 28415 (98)
Loop score = 86329 (2017)
Logic score = 46914 (0)
String score = 3075 (708)
Float score = 19404 (185)
Method score = 27852 (166650)
Overall score = 24003
bash-2.05a$ /tmp/topic/install-1.1.0-i386-linux-jit3/bin/kaffe
CaffeineMarkEmbeddedApp
Sieve score = 28223 (98)
Loop score = 85631 (2017)
Logic score = 46675 (0)
String score = 3092 (708)
Float score = 19871 (185)
Method score = 27787 (166650)
Overall score = 24030
bash-2.05a$ sort -k 3 -g prof.out.107 | grep lang | tail
399008 61.6131 61.6131 0 0.0199567 java/lang/Math.cos(D)D
399008 63.319 63.319 0 0.0247932 java/lang/Math.sin(D)D
1204686 889.254 100.046 789.207 0.0564053
java/lang/StringBuffer.append(Ljava/lang/String;)Ljava/lang/StringBuffer;
47923 122.975 104.673 18.3018 0.133254
java/lang/StringBuffer.ensureCapacity(IZ)Z
1204686 686.346 247.909 438.436 0.172281
java/lang/StringBuffer.append([CII)Ljava/lang/StringBuffer;
398920 2266.61 286.127 1980.49 0.0311805
java/lang/StringBuffer.toString()Ljava/lang/String;
1659624 461.173 461.173 0 0.0186417
java/lang/System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
398800 540.362 540.362 0 0.0348577
java/lang/String.indexOf(Ljava/lang/String;I)I
398920 1945 1660.76 284.24 0.215495
java/lang/String.<init>(Ljava/lang/StringBuffer;)V
1 35.3215 1.28538e+09 -1.28538e+09 0.0949418
java/lang/ClassLoader.getResource(Ljava/lang/String;)Ljava/net/URL;
bash-2.05a$ sort -k 3 -g prof.out.110 | grep lang | tail
3061200 130.774 130.774 0 0.025378
java/lang/Class.isPrimitive()Z
147154 2290.63 136.783 2153.84 0.0444642
java/lang/StringBuffer.toString()Ljava/lang/String;
147000 207.724 207.724 0 0.0345426
java/lang/String.indexOf(Ljava/lang/String;I)I
612234 1805.98 947.763 858.216 1.17382
java/lang/System.arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
147154 2132.92 1323.3 809.622 0.178774
java/lang/String.<init>(Ljava/lang/StringBuffer;)V
15 0.760965 1.28376e+09 -1.28376e+09 0.0399504
java/lang/Class.forName(Ljava/lang/String;)Ljava/lang/Class;
2 6.40007 1.28376e+09 -1.28376e+09 0.143542
kaffe/net/DefaultURLStreamHandlerFactory.tryClass(Ljava/lang/String;)Ljava/net/URLStreamHandler;
23 27.7141 1.54052e+10 -1.54052e+10 0.276968
java/lang/ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;
23 3.75014 1.54052e+10 -1.54052e+10 0.0383629
kaffe/lang/PrimordialClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class;
23 4.19702 1.54052e+10 -1.54052e+10 0.133207
kaffe/lang/PrimordialClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;
on a 2.4ghz p4, running debian linux. so 1.0.7 arraycopy takes a total of
461.173 for 1659624 invocations, where 1.1.0's arraycopy takes a total of
1805.98 for 612234 invocations, i.e. 0.000277878 in 1.0.7 vs 0.0029498198 in
1.1.0.
So Helmer, please feel free to revert the patch, whetever the performance gains
were that I saw back then, they are not here now. ;)
cheers,
dalibor topic
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com