4 Replies Latest reply on May 7, 2007 2:25 PM by 807606

    General performance questions

    807606
      I would like to know how some general performance things that I will try to optimize for the project i am working on, this has effect on a web application.

      If I have a big class with ~100 functions, but you only use 1 function of those, will that matter for Java ?
      Say it was a class with 5 functions, does this work any quicker then 100 or does it not matter ?

      How about parsing xml files, when do you really notice a difference (with like 100 users a second accessing it)?
      Is this for example when the file has 1000 entries, or when it goes to 10.000 ?

      Does putting 1000 of the same objects (say a "User" object but then in 1000 different variations under a different index name) in the request object have any more impact then putting 1 general "Users" objects that contains all those "User" objects?

      I am trying to find out what things I should optimize and what effect it has.
      I know the biggest bottleneck is usually the database, but I know the problems which occur there, and not so much in Java, that's why I ask these questions.

      Thanks
        • 1. Re: General performance questions
          807606
          > I am trying to find out what things I should optimize
          and what effect it has.

          Eliminate the guesswork; use a profiler to determine which things you should optimize.

          ~
          • 2. Re: General performance questions
            jwenting
            > I am trying to find out what things I should
            optimize
            and what effect it has.

            Eliminate the guesswork; use a profiler to determine
            which things you should optimize.
            and start by realising that in the real world most performance problems are caused by external factors (networks, database queries, disk access) rather than Java code.
            Think an application that takes an hour to run to completion, 45 minutes of that waiting for database queries and 10 for disk access. Reducing the time the Java code runs from 5 minutes to 4 (a 20% improvement, not bad at all) won't accomplish a thing.
            • 3. Re: General performance questions
              807606
              hm ok, i was just hoping there maybe is a huge boost to be gained by this.

              but the xml question is pretty external and optimizable, has to access the file and parse this externally
              I assume that when you read an xml file for 30.000 entries, and it is possible to halve these entries in a 2nd file so it has both 15.000, will increase performance alot.
              But my question is when this happens on a big scale (when do you really notice)?

              For the other questions I will try not to bother much with them, but try to do some network optimizing and database optimizing.
              • 4. Re: General performance questions
                807606
                > I assume that when you read an xml file for 30.000 entries...

                Don't assume. Test instead.

                ~