This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: benchmark results [again]


On Thu, 2005-02-03 at 14:10 +0100, Mathieu Lacage wrote:

> Obviously, an optimization of the ArrayList implementation would be a
> huge potential gain. The only worthwhile optimization I can think of
> would be to inline by hand the code in checkBoundExclusive since it
> seems not be inlined by the compiler as shown below.

current cvs HEAD:
real 4.65
user 4.48
sys 0.03

with attached patch:
real 4.51
user 4.35
sys 0.03

I also tried to build the code with -O3 without the attached patch and
with a few final keywords but that did not seem to inline the method
call.

regards,
Mathieu
-- 
? Makefile.6889
? objdir
? patch
? gcc/gimple-dump.c
? gcc/gimple-dump.h
? libjava/out
? libjava/java/util/MainArrayBench.java
? libjava/java/util/bench
Index: libjava/java/util/ArrayList.java
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/java/util/ArrayList.java,v
retrieving revision 1.15
diff -u -r1.15 ArrayList.java
--- libjava/java/util/ArrayList.java	29 Aug 2004 17:28:09 -0000	1.15
+++ libjava/java/util/ArrayList.java	4 Feb 2005 08:26:17 -0000
@@ -306,7 +306,9 @@
    */
   public Object get(int index)
   {
-    checkBoundExclusive(index);
+    if (index > size)
+      throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
+                                          + size);
     return data[index];
   }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]