Slashdot Mirror


Eye on Java performance Improvements

An anonymous reader writes "Performance. It's the one aspect of the Java platform that continually takes abuse. But the overwhelming success of the platform on other fronts makes performance issues worth serious investigation. In this article, Intrepid optimizers Jack Shirazi and Kirk Pepperdine, Director and CTO of JavaPerformanceTuning.com, look at compilation speed, exceptions, and heap size tuning."

11 of 84 comments (clear)

  1. "Level: Introductory" by jtheory · · Score: 4, Informative

    Level: Introductory
    Just a note -- don't bother reading if you've ever looked into Java tuning before.

    I admit I only skimmed the article... but the tips I saw are all simple suggestions that have been around for years now.

    Use Jikes for quick compilations? Jikes has been around since before the Java 1.2 days.

    Only throw Exceptions in "exceptional" cases, because they will slow things down? Again, advice I've been hearing since the early days.

    Nary a word about exploiting the new IO classes, or evaluating performance of XML vs. custom formats, etc. etc.

    --
    There are only 10 types of people: those who understand decimal, those who don't, and, uh, 8 other types I forget.
    1. Re:"Level: Introductory" by Ian+Jefferies · · Score: 3, Informative

      There's a technical paper on HotSpot technology that covers much of the ground. It does mention range checking removal, but also some of the complications: dynamic loading of classes, runtime reflective method calling, and adherence to the Java security model. From a quick read it suggests that flow analysis is appropriate for inlining virtual method calls, and that de-optimization has to happen when the environment changes. Complicated stuff.

      I know enough about compilation optimization to appreciate how complicated a subject it is, and that many optimizations can appear to be counter-productive. I'm always going to have an interest in it, but don't think I'm ever going to be working on it from the inside by doing software research.

      Cheers,

      Ian.

      --
      A physicist is an atom's way of thinking about atoms
  2. Article doesn't say much by cxvx · · Score: 5, Informative
    There are better articles on the IBM site discussing java performance:

    Knowing when to optimize is more important than knowing how to optimize
    Urban performance legends

    --
    If only I could come up with a good sig ...
  3. java and net by raffe · · Score: 2, Informative

    Here is a recent study about java and .net.
    The result ?

    "The Middleware Company has released a J2EE and .NET Performance case study, the latest study (an MDA productivity study was released a few weeks ago) based on their Application Server Baseline Spec. Except for the web services test, the two platforms came out mostly equal in performance. "

  4. Quick useful user-level approach by 0x0d0a · · Score: 2, Informative

    From a user's point of view, here's what's important WRT Java.

    * Java still uses a lot more memory and cycles than C/Pascal/C++/etc. Generally, if there's a Java program and a C equivalent, you want to use the C equivalent.

    * The IBM JDK is the fastest current way to run Java on Linux.

    * Eclipse is the free Java IDE that everyone loves.

    * No, the Freenet people still haven't made a C version.

  5. Re:Free Java Performance Tips by El+Neepo · · Score: 2, Informative

    looks like you need to read this

    http://www-106.ibm.com/developerworks/java/libra ry /j-jtp04223.html

  6. Re:Free Java Performance Tips by Golthar · · Score: 2, Informative

    *Depends, when the data is suposed to be inmutable, you should use Stings (constants)
    If you are constructing your data, then a Stringbuffer is indeed best (In fact, Javac will try to use a Stringbuffer internaly)

    *Synchonisation is getting better with every release, now ofcourse you should not synch more than needed, but if you don't synch properly, you will find that deadlocks will be a far worse performance problem.

    *Yes, but sometimes it needs to be able to run on lower than 1.4 versions.
    Also, the NIO classes have been a moving target (the first implementation was not very platform independant, had small differences between VM's.
    I suggest you detect the VM version and load a class that implements your loading based on the available methods.

    *Try not to create more than needed.
    Also, try not to hold on to these objects too long.
    The VM works with different spaces in memory and short lived objects will be GCed and reused with ease.
    This rule does not apply to hard to create objects (like a Database connection, which needs to be created at some point and should be pooled)

  7. Re:Question for Java and Perl developers by LunaticLeo · · Score: 2, Informative

    I think Perl. Use POE; see poe.perl.org. Fast well structured code. POE is gods gift to Perl programmers (or at least Rocco Caputo's Gift).

    Otherwise use java.nio. Unfotunately, since it is a new api there is only one shitty application framwork built around it called SEDA. At first, I thought SEDA was cool, then I used it, found problems, tried to report problems, got no response, noticed there have been no updates in nearly a year. Fuckers.

    If you like Python there is a feature rich, event loop style app framwork called TwistedPython. Haven't used it but it looks good. Check out www.twistedmatrix.com .

    --
    -- I am not a fanatic, I am a true believer.
  8. Re:Slow is relative by Anonymous Coward · · Score: 1, Informative

    *cough* JNI *cough*

    public native void slowInJava(...);

    Care to try again?

  9. Re:If performance is an issue, why use either? by Anonymous Coward · · Score: 1, Informative

    because writing web applications in C/C++ takes too long.

  10. Re:Slow is relative by smallpaul · · Score: 2, Informative

    First, compare the ease of implementation to Python...especially when it comes to garbage collection and threading. Second, Python folks won't look down on you for using C where it is appropriate. Sun has this big marketing campaign about how code should be "100% Java". Third, Python people have worked much harder on tools to make integrating C easy: Pyrex, Distutils, SWIG, CTypes, win32com and pyxpcom.