Here are the results from the last version of the TestDatePerf program I
sent out.  Below are the results from 3 different systems when run for 1
million iterations.

Here's how I interpret the results:

The program verifies the synchronization performance issue.
Dual-CPU machines take a huge performance hit when going from 1-2
processes fighting for the same synchronized lock.  The dual processor
machine always performs worse than the single processor with more than 1
thread running and doesn't start catching up until 16 threads are running.

I did a few test runs when running 2 threads and watching the output from
top, I noticed that both CPUs were not kept busy (as expected).

Out of curiosity, I also tweaked the progrom and took out the call to
Timestamp.toString() and replaced it with some non-synchronized code. 
This code scaled almost perfectly when going from 1 to 2 threads on the
dual-cpu systems (run-time cut very close to 1/2) and increasing the
number of threads to 16 showed very little performance deviation over the
2 thread case.

So it looks like the bottleneck is real and depending on CPU performance I
would guess that you would start seeing when when you start making a few
thousand calls a second to these methods.

-Dave

------------

Each system ran the following:
time java TestJavaPerf <threads> 1000000
with threads values of 1, 2, 4, 8, 16.

All Linux systems on on kernel 2.4.20.  It would interesting to see if
recent 2.5.x kernels perform better as they reported have improved
multi-thread performance in the latest development kernels.

System 1:
Duron 600MHz, Sun Java 1.4.2, RedHat Linux

System 2:
PIII 500MHz, Sun Java 1.4.2, RedHat Linux

System 3:
Dual PIII 500MHz, Sun Java 1.4.2, RedHat Linux

System 4:
Dual Mips R10k 225MHz, SGI Java 1.4.1 SGI IRIX

Sys# Threads  Real   User   Sys
1    1        60.3   59.6   0.2
1    2        78.2   72.8   5.3
1    4       122.0   93.1  28.8
1    8       152.1  105.0  47.0
1    16      184.4  121.6  62.7
Sys# Threads  Real   User   Sys
2    1        80.5   80.2   0.3
2    2       108.0  111.2   3.2
2    4       177.2  141.5  34.4
2    8       290.1  200.3  88.5
2    16      325.2  220.0 103.9
Sys# Threads  Real   User   Sys
3    1        80.4   80.2   0.4
3    2       249.3  221.3  94.8
3    4       289.8  244.0 124.8
3    8       309.8  257.6 130.5
3    16      325.4  264.4 132.2
Sys# Threads  Real   User   Sys
4    1       197.0  186.9   1.5
4    2       289.7  487.5   8.9
4    4      1148.9  996.9 267.0
4    8      1734.8 1086.0 284.3
4    16     1717.2 1058.4 284.8


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to