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.'"

6 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 %]
  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:AspectJ by javaxman · · Score: 4, Interesting
    Byte-code hacking!? Why not simply use AspectJ?

    You could as easily ask "Why use AspectJ", couldn't you?

    I mean... what you're trying to do in the case of profiling is _not_ change the actual byte code you're working on any more than neccessary. Is using the aspectj runtime somehow better than using the -javaagent JVM option? I'm going to guess here... not neccessarilly, unless you're using AspectJ anyway. If you're _not_ using AspectJ and are not familiar with all of the extra syntax that AspectJ introduces, it becomes very unclear that doing your profiling that way is really a good way to go.

    How would you specifically do the same thing they're talking about in the article using AspectJ ? I'm asking as a Java programmer who has shied away from using AspectJ ( the reasons for using it to me have not become terribly compelling; I'm aware that some folks love it ). Is there an article somewhere that spells out how to do the same sort of thing using AspectJ or some other AOP system? Maybe that would be a helpful link, or make another good story.

  4. Re:Why? by animaal · · Score: 5, Funny

    I agree totally. Java is dead. We just have to get the message through to the huge numbers of organizations and developers who depend on the technology to get their jobs done. Oh, and then we have to come up with something better to replace it. Give me a little while... ;)

  5. 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

  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.