Hum - profiling is much harder than you might expect.
I was getting some of those times by using
System.System.currentTimeMillis(). Its supposed to be accurate to 10ms
on windows XP, but I dont think so. Creating 5 images seems to take
the same amount of time as creating one (!!). There could be weird
things going on with logging, garbage collection, and interaction with
the OS clock.
I'm going to assume that what java is reporting for time is wrong and
that creating a bufferedimage is quick. I dont know why its saying its
taking 300ms....
I'm going to try to parallelize lite and see if it speeds things up.
dave
----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/
dblasby@anonymised.com wrote:
Hum - profiling is much harder than you might expect.
I was getting some of those times by using
System.System.currentTimeMillis(). Its supposed to be accurate to 10ms
on windows XP, but I dont think so. Creating 5 images seems to take
the same amount of time as creating one (!!). There could be weird
things going on with logging, garbage collection, and interaction with
the OS clock.
May I suggest you to use hprof along with hpjmeter? Also, don't perform
a single run, but repeat image creation at least 10 times and average (the
profiler will aggregate data for you).
Instructions on how to use hprof can be found here:
http://www.javalobby.org/java/forums/t19612.html
whilst hpjmeter (user interface that loads and displays the profiles) can
be found here:
http://www.hp.com/products1/unix/java/hpjmeter/
Oh, usually I use a sampling depth bigger than 10 (suggested in hpjmeter
user guide), more something like 40 since the stack traces are quite
deep in geotools (and even deeper in geoserver if you're profiling it).
Hope this helps
Best regards
Andrea