K
Kenneth P. Turvey
I've written some code and it is running much slower than I would like it
to. I'm from the C school of optimization which says that you write the
code the best way you can and then when you get done you run it through a
profiler to get the optimization done. This has always served me well in
the C world. To paraphrase Knuth, "Premature optimization is the root of
all evil."
So this has been the philosophy I've used in Java as well, but now it just
doesn't seem to be serving me well. The profiler isn't showing any really
hot spots that need work (which was quite surprising) and it shows only a
very small amount of time being used in garbage collection. Yet the code
is much, much slower than other implementations in C or C++.
So what is the best procedure for getting performance from a Java
application?
Thanks.
BTW, I'm using the profiler that comes with NetBeans.
to. I'm from the C school of optimization which says that you write the
code the best way you can and then when you get done you run it through a
profiler to get the optimization done. This has always served me well in
the C world. To paraphrase Knuth, "Premature optimization is the root of
all evil."
So this has been the philosophy I've used in Java as well, but now it just
doesn't seem to be serving me well. The profiler isn't showing any really
hot spots that need work (which was quite surprising) and it shows only a
very small amount of time being used in garbage collection. Yet the code
is much, much slower than other implementations in C or C++.
So what is the best procedure for getting performance from a Java
application?
Thanks.
BTW, I'm using the profiler that comes with NetBeans.