This is the mail archive of the
mailing list for the Java project.
Re: Deserialization speed?
- To: Barnet Wagman <wagman at enteract dot com>
- Subject: Re: Deserialization speed?
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Sat, 27 Jan 2001 18:28:09 +1300
- CC: "java-discuss at sources dot redhat dot com" <java-discuss at sources dot redhat dot com>
- References: <3A71C680.A74BB476@enteract.com>
Barnet Wagman wrote:
> With the change that Warren suggested, gcj deserialization works with
> version cc version 2.97 20010117 (experimental).
> However, in a non-test case with a largish serialized object (~ 7 mg),
> derserialization is very slow, ~ 300 seconds compared to ~ 6.5 seconds
> using the jvm. Any idea as to what's going on?
Having looked at the serialization code today I can tell you that it
definatly does not appear to have been written with efficiency in mind
Profiling with gprof may well give some insight as to where the worst
A couple of possibilities (although I'm not sure if these alone would
account for the exponential slowdown you are seeing):
1. There is a lot of debugging code present in the ObjectStream classes
which is disabled by default by setting a boolean constant. Unfortunatly,
the compiler isn't yet smart enough to actually optimize this out
(especially considering that we don't even compile libgcj's java code
with optimization yet).
2. Serialization relies on reflection, which is known to be quite slow in
[ bryce ]