wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Bad Performence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Bad Performence" Watch "Bad Performence" New topic
Author

Bad Performence

pascal auderset
Greenhorn

Joined: Aug 21, 2002
Posts: 15
Hi
Do you also have such a bad performence when you do a test like this:
main ...
for (int i = 0; i < 50; i++) {
Thread t = new TestThread();
t.start();
}
class TestThread extends Thread {
public void run() {
String thread = Thread.currentThread().getName();
try {
FlyByNightService service = connection.getService(db);
for (int i = 1; i < 10; i++) {
service.lock(i);
DataInfo info = service.getRecord(i);
service.unlock(i);
}
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
}
The database is the db.db file from sun.
In my case this test takes 2minutes 20 sec.
Pascal
Matt Ghiold
Ranch Hand

Joined: Feb 24, 2002
Posts: 213
Pascal,
Answering that question is very tricky, cause perfomance is not based on software alone.
I can take the best piece of software and run it on a 400mtz and have really bad performance.
I will tell you this, I have run something very similiar on my system and it took <1min, but im running on a 2.4gtz machine with 1/2 a gig of ram.
Hope this helps.


-Matt<br /> SCJP2<br /> SCJD
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

but im running on a 2.4gtz machine with 1/2 a gig of ram.

Not if I find out where you live.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

In my case this test takes 2minutes 20 sec.

I am not sure what you are doing (maybe your server is in California and the client is in Massachusetts), but a similar test takes less than 10 seconds on my 800MHz machine.
You are running 50 threads each geting 10 records, but try the opposite, -- 10 threads each getting 50 records and see what happens.
Eugene.
[ January 17, 2003: Message edited by: Eugene Kononov ]
 
Don't get me started about those stupid light bulbs.
 
subject: Bad Performence
 
Similar Threads
calling start() twice on a thread.
Is this thread safe?
need a bit explaination with threads......
Thread - instance variables
how to simulate multi-thread to test Data ?