Performance improvements


Performance and scalability: Performance improvements

  1. Performance improvements (5 messages)

    I have a java program function which returns vector with 50,000 records in it.But from my JSP when i made a call to it and using 10 records per time.So, i want to improve the performance of my application.What is the best way to go?


    Threaded Messages (5)

  2. Performance improvements[ Go to top ]

    Hi Siva,
    There is one thing I can suggest, but not sure whether it fits into the requirement or not.

    1. One thing is sure, you will not display all the 50,000 records on the jsp page 10 at a time. Because if the user wants to go the 49000th record he has to press the next button 4900 times.

    2. So why are you getting 10 records at a time to the jsp page. ?

    3. Insted you can do one thing. Pull in this data into a Hashtable or Hashmap and based on the key value get the required information on the jsp page.
    Assume that you are getting names in a vector like

    Instead get them with a key and put into a hash table and retrieve only those records to the jsp page.


    Now you can get the method that puts only the required records into a vector. Like between 1 to 3.

    Then u can display these records in the jsp page.

    To sum it up briefly.
    Step:1 Put the records with a key in a hashtable or hashmap.
    step:2 write a method that gets the required values into a vector.
    step:3 display only those values in the jsp page.

    Hope this helps.

  3. JDBC Performance Tuning Tool[ Go to top ]


    You could try IronTrack SQL to help you identify what's going on. There is a free trial available.
  4. You could change your SQL[ Go to top ]

    If you're returning 50,000 records in a Vector, there'll be performance problems if you ever serialize those vectors, plus memory usage can grow pretty rapidly if many clients have separate vectors. Assuming you're getting the records from a database, some database servers allow you to choose just some of the records. This can help a lot if your data is static (no rows added or deleted when the records are viewed). If you're using Microsoft SQL Server, for example, take a look at this resource:

    Using this method, you can reduce the number of records from 50,000 to just 10.

    Pietari Laurila
  5. Use an object database[ Go to top ]

    Maybe you can consider an object database instead of a RDBMS. They handle these types of problems much more effeciently with sort of lazy loading the content of vectors. They use the hollow object mechanism for it found in the JDO spec.

    Otherwise you should further optimize your query that's used to pick up the 50.000 records. It should be redesigned to pick up the 10 needed by the JSP instead. Let the database do the job. It's designed to perform queries as quickly as possible. Java is not.


  6. Try Elvyx ...[ Go to top ]

    We were using p6spy and IronGrid but we could not find the IronGrid code to fix some bugs. Then, we started implementing a client for p6spy and we finished implementing the full solution. This application is Elvyx and can be downloaded from: I think this tool could be useful to the community. Armando ;-)