Slashdot Mirror


Build Your Own Java Performance Profiling Tool

An anonymous reader writes "IBM DeveloperWorks has an interesting look at creating a custom profiler using Java 5 and AOP. From the article: 'Profiling is a technique for measuring where software programs consume resources, including CPU time and memory. This article provides a list of best-of-breed features you might look for in an ideal profiler and explains why aspect-oriented techniques are well suited to achieving some of those features. It also introduces you to the JDK 5.0 agent interface and walks you through the steps of using it to build your own aspect-oriented profiler.'"

8 of 153 comments (clear)

  1. jrat - Already does everything you need. by tezza · · Score: 4, Informative
    Forget this article AOP Build Your Own. By the time you finish reading the article you could have used jrat .

    Download jrat here

    I've used it many times, and it's helped me find horrible Hibernate queries, Lucene bottlenecks, Batik rendering pipeline issues. It is fantastic.

    --
    [% slash_sig_val.text %]
    1. Re:jrat - Already does everything you need. by andrewwilcox · · Score: 2, Informative

      The article is more than just how to build an AO profiler -- it's about how to use the Java 5 agent interface to create AO-based solutions. As for jrat -- the big different between JIP (which is discussed in the article) and JRat is that JIP instruments your code at runtime rather than requiring a separate step.

  2. Re:If you're optimizing Java, you're sunk by HotBBQ · · Score: 5, Informative

    That's simply not true. I work on a large Java project that deals with a lot of matrix intensive work. Our Java code has been rigorously architected, engineered, and optimized. The matrix code in particular (where the majority of our processing time is spent) is far superior in Java than it was in C or C++. Every programming language has its place, use the one that suites your needs. Profiling most any code can reveal useful information.

  3. Re:HP is your friend by andrewwilcox · · Score: 2, Informative

    These two tools aren't profilers, there anaylsis tools. hpjmeter uses the output generated by hprof (the profiler that ships with the JDK) and the other tool you mentioned analyzes the garbage collection log. The problem with traditional tools like hprof is that 1: they require native components and 2: they don't let you turn the profiler on and off at runtime and 3: they profile everything -- even things that you as a developer can't change.

  4. Re:you really need more than hprof ? by andrewwilcox · · Score: 5, Informative
    As was noted in the article, hprof has a number of short falls:
    • It is slow. If you've spent any amount of time using hprof, then you know what I'm talking about!
    • You can't start and stop it at runtime. If you've ever tried to profile a web application with hprof, you know what I'm talking about!
    • Filtering. hprof profiles everything and so it's slow and that output is expansive. When I'm profiling code, I want to know how my code is performing, not how some third party library is performing.

    I like hprof -- it's helped me out more times that I can say, but it also has some short comings, which is why I developed JIP

  5. Re:If you're optimizing Java, you're sunk by Doc_NH · · Score: 1, Informative

    Ever heard of HotSpot? Java JVM does runtime optimization that C/C++ can't. No it doesn't happen in a two second bench test designed for C to prevail, but use in real life applications the JVM performance improves with longer runs. If you honestly look into it and realize that your "java is slow" mantra is a bit dated or is that a SlashDot fact that is not refutable?

    --
    if vegetarians eat vegetables why are cannibals not humanitarians.
  6. Re:Quick! Name a successful Java program. by Anonymous Coward · · Score: 4, Informative

    "Quick! Name a successful Java program. Nope. I can't think of one either."

    Gmail. It uses Java for almost all of its back end. In fact almost all of Google's large scale web applications use Java in some form. Python is also used extensively however, it's generally used for simple scripts and smaller applications. Tons of websites use Java extensively and people like you are just too dumb to realize it. If you do online banking it's almost guaranteed that the website is using server side Java.

    In terms of client side applications there's; Azureus, LimeWire, Eclipse, Netbeans, Intellij IDEA, Yahoo Site Builder, ZipCreator, Summit Groupware, jEdit, SmartCVS, NeoOffice etc. etc. Just because you don't use them doesn't mean that they're not there. The truth is that most people only use a very select few programs and these programs are often using code bases that are over 10 years old (ie. Microsoft Office, Outlook, Internet Explorer etc.). Then there's all the enterprise applications that are written in Java.... In the enterprise world Java is dominant and the only real competitor is .NET.

  7. Re:IDE/platform integration is, well... integral by Anonymous Coward · · Score: 1, Informative

    Netbeans has a pretty good profiler, much better than anything for Eclipse (I haven't found any good profilers for Eclipse either, though it's a good IDE)

    http://profiler.netbeans.org/