Profiling xstream

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Profiling xstream


        My application has two possible startup states:

- No configuration file is found, using the default settings and
generate a new configuration file on shutdown

- Configuration file is found, read objects using XStream's

        I have noticed that when a configuration file has to be loaded by
XStream, it takes 1.7 seconds for a 70k file. An extra 1.7 seconds
startup time is a major problem for my client-side application because
it translates into an increase by 37% and is very noticable. And this is
only with a relatively small configuration file, so I worry what happens
as it grows.

        I tried using JProfiler to track down what is bogging down the CPU but
all I see is:

ObjectInputStream.readObject():397 invoking
CustomObjectInputStream.readObjectOverride() invoking
XStream$2.readFromStream():66 invoking
XStream.unmarshal():774 invoking
XStream.unmarshal():500 invoking
[... goes on and on ...]

        At no point is any of my code being invoked as far as I can see (in the
form of readResolve() etc). Is there any way for you guys to profile
XStream to optimize it further or suggest ways for me optimize the
configuration file loading process? Is this a normal loading time for 70k?

Thank you,