Java Performence

Discussion in 'Java' started by kris, Jun 5, 2006.

  1. kris

    kris Guest

    Hi, I need the info of how to tune the performence based on data
    structures used. Like Collections.

    Thanks & Regards
    Krishna Prasad.
     
    kris, Jun 5, 2006
    #1
    1. Advertising

  2. kris

    teja Guest

    hi,
    try
    http://www.javaperformancetuning.com/

    /tejas

    kris wrote:
    > Hi, I need the info of how to tune the performence based on data
    > structures used. Like Collections.
    >
    > Thanks & Regards
    > Krishna Prasad.
     
    teja, Jun 5, 2006
    #2
    1. Advertising

  3. In article <>,
    "kris" <> wrote:

    > Hi, I need the info of how to tune the performence based on data
    > structures used. Like Collections.


    The very first step: measure. Either acquire a profiler, or write in
    some performance tests with System.getTimeMillis. Look for hot spots,
    high execution counts, and memory blowouts.

    The second step: interpret. Ask yourself whether the results you are
    getting 'make sense'. For example, if your app or your microbenchmark
    takes a long time to query for a piece of data, ask whether it _should_
    take a long time to query that data. Is the data store keyed by some
    key, and stored in a Map, or is it testing against a linked list with
    ..equals.

    The third step: decide if you have a problem to fix. For example, if
    your test case is storing a hundred names, then searching for 'Herb
    Philbrick' five times, you probably saw no problems, but if you are
    searching for all names containing 'Bob or Robert' out of ten million,
    then you just might.

    The fourth step: decide the problem level. If your problem is that
    retrievals are slow, you would be better served using a database or a
    map than trying to write a better sort-and-binary-search.

    The fifth step: with a goal in mind, and a plan, recode.

    The final step: measure again, and write down what you found. You will
    find that the notes are worth more than the numbers, as new VMs change.
    Jack Shirazi's "Java Performance Tuning" is a bit dated by now, but you
    can run his tests on recent VMs and get results that are still
    applicable.

    Scott

    --
    Scott Ellsworth

    Java and database consulting for the life sciences
     
    Scott Ellsworth, Jun 5, 2006
    #3
  4. kris

    kris Guest

    Thanks Scott Ellsworth

    Thanks & Regards
    Krishna Prasad.VCVR.
     
    kris, Jun 6, 2006
    #4
  5. Scott Ellsworth wrote:
    >
    > The very first step: measure. Either acquire a profiler, or write in
    > some performance tests with System.getTimeMillis. Look for hot spots,
    > high execution counts, and memory blowouts.


    It's also worth doing back-of-an-envelope calculations. Say I have an
    O(n^2) algorithm, are there realistic but not necessarily particularly
    common situations when it's going to blow up? You need to know what to
    measure.

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
     
    Thomas Hawtin, Jun 6, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Novice
    Replies:
    1
    Views:
    1,168
    Mike Schilling
    Jul 19, 2003
  2. Michael Kintner
    Replies:
    0
    Views:
    853
    Michael Kintner
    Nov 30, 2003
  3. Ilias Lazaridis
    Replies:
    0
    Views:
    587
    Ilias Lazaridis
    Feb 1, 2005
  4. manish sahu
    Replies:
    3
    Views:
    1,012
  5. Isaac
    Replies:
    0
    Views:
    381
    Isaac
    Jan 20, 2011
Loading...

Share This Page