Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Performance Issue  RSS feed

 
Karthik Kannan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
We developed a set of components in java for updating records in tables in DB.
The process goes like this...
1. fetch input data through a HashMap
2. fetch nearly 200 rows one by one to get the updating factor (some delta)
3. put all the processed data in an ArrayList
4. persist the ArrayList objects

The program is working fine. But taking more time to execute.
What i mean to say is there are some performance issues. Is it due to concurrent fetching of data from the database or using bulky ArrayList objects (nearly 6000).


Help me Guys...

Thanks in advance...
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a number of things you can do, including:

4. Profile your Java app to see which routines are taking the most time (this may or may not be a viable option, depending on how complex your app is and how much of it you control)

3. Use system tools like "top" (Linux) or "perfmon" (Windows) to see which processes might be CPU hogs

2. Use the system tools that come with your database (e.g. TKPROF for Oracle or Query Analyzer for SQL server) to check if your queries are efficient (or your database is properly indexed).

... and ...

1. Stub out your database lookup and replace it with a method that just reads a bunch of stuff from a text file.

If the app-without-the-database-I/O suddenly improves dramatically, the culprit is probably with your SQL. If there's no difference, the problem is something on the Java (application) side.

'Hope that helps .. PSM
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Performance forum...
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also try running it with the -Xprof option. This will give you a lot of useful information. And the -Xloggc:<file> option can also be quite useful.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!