File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Performance question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Performance question" Watch "Performance question" New topic

Performance question

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
I have a JTree that is being populated via a ResultSet everytime the user presses the button.
On my PC, when I run it, it takes the tree about 8 seconds to come up.
I tried two other PC's this app is running on, one of them took 14 seconds, and the other, only took 4 seconds to come up.
I guess my question is, why is the performance really fast on one machine, and really dumpy on another?
I thought maybe the stored procedure was causing the poor performance, but is this possible, even though on a different PC, it is much much faster?
Is it maybe more of a PC issue rather than a database issue?
Thanks for any help you can give me!
Joe Ess

Joined: Oct 29, 2001
Posts: 9126

Originally posted by Jennifer Sohl:

Is it maybe more of a PC issue rather than a database issue?

Very much so. There are a number of factors that impact computer performance. Processor speed, bus speed, memory cache, available RAM, number and load of other applications and so on. Database calls usually start off CPU-bound, that is, their performance is limited by CPU speed, but very quickly become memory-bound, since every table in a query has to be passed through RAM during the query. You can use the task manager in Windows or "top" in Linux to watch the load your application puts on a computer. If you can hear the hard drive churning when you run your query, you have run out of memory and the CPU is wasting cycles swapping RAM to disk and vice versa. In the business world it is almost always cheaper to solve such performance problems by buying newer/better hardware than to spend developer time chasing bottlenecks.

[How To Ask Questions On JavaRanch]
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
subject: Performance question
It's not a secret anymore!