I have been working with java for a while and some programs I have made are terribly slow and parts of them run at abysmal speeds. I feel there should be a debug tool as an eclipse extension or as an existing feature that shows what lines or sections of the code are taking the longest to finish executing. Is there such a tool I could use, or is there a better way to check for optimization?
+1 for measuring before optimization!
The default jvisualvm and its Sampler tab can easily pinpoint the bottlenecks for you.
jvisualvm is on the same path as javac, so you just type jvisualvm to the console, and it runs.
On the screenshot below you can see how I'm sampling eclipse. You can sample your own program too, just select the program on the Applications bar.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With