String call stats

Artur Biesiadowski abies at pg.gda.pl
Wed Feb 9 11:19:58 PST 2000


Going a bit further I've collected few statistics on String usage in two
java apps. Maybe somebody will find it useful.

All numbers are calls from jitted code - thus for SwingSet init part is
not taken into account (as it turns off jit for some initializations).
SwingSet is demo app from JDK, after browsing all tabs. kjc is compile
run on SwingSet source (I had to change kjc source to add busy wait
after compiling).


                 SwingSet         kjc

All calls       7.904.479      18.138.133
String.*          549.687       2.059.670
String.charAt     309.279       1.033.904
String.hashCode    36.775         107.041


String.* include both figures below it. It is clear that String.charAt
is single most often called String method (and maybe single most often
called method in entire system ?). I've also included hashCode number to
see if caching String hashcode is worth it - I'm bit disappointed by
this count, I was awaiting greater number, especially in kjc. It is
space versus speed, as always :)

Have anyone from gcj team done any profiling on generated code to see
how well Strings behave there ?

Artur



More information about the kaffe mailing list