This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: Minor object serialization optimization
- From: Anthony Green <green at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: 07 Sep 2002 13:43:04 -0700
- Subject: Patch: Minor object serialization optimization
The overhead of the debugging support in ObjectInputStream seems excessive (from
visual inspection at least :-).
Here's one of the obvious offenders. I think we should consider wrapping
all calls to dumpElementln with Configuration.DEBUG && dump checks.
Ok?
2002-09-07 Anthony Green <green@redhat.com>
* java/io/ObjectInputStream.java (readObject): Minor optimization.
Index: libjava/java/io/ObjectInputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/ObjectInputStream.java,v
retrieving revision 1.12
diff -2 -c -p -r1.12 ObjectInputStream.java
*** libjava/java/io/ObjectInputStream.java 24 Jul 2002 16:05:34 -0000 1.12
--- libjava/java/io/ObjectInputStream.java 7 Sep 2002 20:34:47 -0000
*************** public class ObjectInputStream extends I
*** 244,249 ****
int handle = assignNewHandle (array);
readArrayElements (array, componentType);
! for (int i=0, len=Array.getLength(array); i < len; i++)
! dumpElementln (" ELEMENT[" + i + "]=" + Array.get(array, i));
ret_val = processResolution (array, handle);
break;
--- 244,252 ----
int handle = assignNewHandle (array);
readArrayElements (array, componentType);
! if (Configuration.DEBUG && dump)
! {
! for (int i=0, len=Array.getLength(array); i < len; i++)
! dumpElementln (" ELEMENT[" + i + "]=" + Array.get(array, i));
! }
ret_val = processResolution (array, handle);
break;