Mike\’s Blog

April 9, 2006

Java Performance in Dual Core/Multiprocessor Environment with Linux results

Filed under: Software Development — mlee888 @ 8:49 pm

April 9, 2006

 

I ran the tests on a Linux box over the weekend.  Since I also have the Intel Matrix storage RAID controller on my home dual core machine as well as the 955EE, I have been unable to find time or willing to take the chance to fiddle with the drivers to get Linux to boot on these without potentially killing my RAID configuration.  

 

This is from a hyper-threading capable 2.8GHz machine with 1GB RAM, single SATA disk.  Similar results were found against StringBuffer where without HT enabled, it ran a lot faster.  “-server” option has a significant impact, as you might expect.   In general, however, Linux performance with Vector with –server option is significantly faster than Windows’ implementation.    I am not quite sure why without HT, the ArrayList operations took a lot longer than the version with HT.   I suspect that it may have to do with the garbage collection that may be occurring immediately after the Vector operations, affecting the results of the ArrayList operations.   I suspect that the data read without sync also may be impacted similarly.

 

In any case, based on these results and more importantly real world application observation, this continues to suggest that you need to pay close attention to synchronized or unintended synchronized usage in your code when they run in multiprocessor environments vs. single processor environment.  However, if your application is single threaded, it will be very worth while to try this option:

-XX:+UseBiasedLocking comments

With this option, significant performance improved in some non-contented monitor acquisitions, dramatically improving performance on some of the test results.  With additional –server option, the tests ran even faster.  

 

 

 

Linux – Java 1.5.0_06-b05

Fedora 2.61.11-1.1369_FC4smp

Intel 2.8GHz  (average over 5 runs)

 

With HT

Without -server option

Without HT

Without –server option

With HT

With -server

Without HT

With -server

StringBuffer (bunch of appends)

10.415

2.006

5.858

0.776

StringBuilder (same op as StringBuffer)

0.917

0.911

0.617

0.4118

Vector operations

18.383

17.691

2.857

2.320

ArrayList operations

17.569

17.791

2.0045

10.088

data file (write) with sync

2.085

1.111

1.907

0.765

data file (write) without  sync

1.004

2.470

0.868

0.865

data file( read) with sync

5.211

1.007

1.860

0.777

data file (read) without sync

4.032

2.707

2.634

0.657

 

Windows XP x64 – 32bit VM

Intel 955EE, 3.46GHz

-XX:+UseBiasedLocking

Dual Core + HT

 

Without -server

Dual Core + HT

 

With -server

StringBuffer (bunch of appends)

0.984

0.453

StringBuilder (same op as StringBuffer)

0.484

0.328

Vector operations

9.609

6.25

ArrayList operations

9.780

1.563

data file (write) with sync

1.421

1.281

data file (write) without  sync

0.843

0.687

data file( read) with sync

2.032

1.422

data file (read) without sync

1.484

0.625

 

 

 

Advertisements

1 Comment »

  1. Hello there! This article couldn’t be written any better!
    Looking through this article reminds me of my previous roommate!

    He continually kept preaching about this. I will forward this article to him.
    Pretty sure he’ll have a very good read. Thanks for sharing!

    Comment by Bee Control Products Johannesburg — May 1, 2014 @ 1:31 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: