Re: Java slow on Xeon processors ?
From: Marc Slemko (marcs_at_znep.com)
Date: 05/25/04
- Next message: Sudsy: "Re: can not save(insert) data to MS SQL in JSP"
- Previous message: Victor Chew: "Re: exe"
- In reply to: Michael Kreitmann: "Re: Java slow on Xeon processors ?"
- Next in thread: Juha Laiho: "Re: Java slow on Xeon processors ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 May 2004 03:25:15 GMT
In article <987ebcdd.0405240650.4040252f@posting.google.com>, Michael Kreitmann wrote:
> First of all: Thanks for your answers!
> I've done another test on my P4 with activated Hyperthreading and ...
> the performance is very bad (9s <> 2s without HT).
> (The test on the 1xXeon/1800 will hopefully come tomorrow!)
>
> So: Java (?) does have a problem running on dual-processor machines ?
> Can this be right ? I can't believe, but what can I do ??
Do you have to do anything?
Do you have reason to think this is a performance issue in your
code caused by this?
What your code is doing is essentially 35 million synchronized
method calls per second. Yes, synchronization is typically more
expensive on a multiproc system.
With some JVMs on some systems, adding a synchronized(result) block
around the whole result.append() loop could reduce this overhead;
with other JVMs it may hurt.
If you need this case to perform well, you need something like the
StringBuilder class in 1.5 that isn't synchronized. The typical
app, however, isn't going to be doing 35 million StringBuffer.append()
calls per second, so it becomes a very trivial difference in
performance.
I can reproduce the behaviour you desribe, if I change to a
StringBuilder then a dual 2.4 GHz Xeon is slightly faster than a
single 2.4 GHz P4, which is pretty much exactly what is expected.
There are all sorts of interesting differences... why the 1.5 beta JVM
is slower on a single proc system ... why the IBM 1.4 JDK is slower if
you add the synchronized block I mention ... but the bottom line
is that there are very few applications where it matters. For some
it does, which is the reason why the unsynchronized StringBuilder
was added to 1.5.
Performance is important, yes, but in context.
- Next message: Sudsy: "Re: can not save(insert) data to MS SQL in JSP"
- Previous message: Victor Chew: "Re: exe"
- In reply to: Michael Kreitmann: "Re: Java slow on Xeon processors ?"
- Next in thread: Juha Laiho: "Re: Java slow on Xeon processors ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|