HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Hardware Newsgroups > Brand-name systems > SUN

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-11-2008, 05:12 PM
thegman
 
Posts: n/a
Default Performance anomaly on T5140

Today, to kill some time, I wrote some Java to make 96 threads, do
some crypto stuff, and put the results into a Hashtable. I did this
primarily to pass time and also to see how the T5140 performed with
this number of threads. To compare results, I ran the same program on
my G5 Mac. The results surprised me a bit as they were roughly the
same. It seems odd to me that a 12 core T5140 would be about the same
as a 2x2GHz Power Mac G5, when every benchmark I read would say that
the T5140 would be very significantly quicker, especially under such
heavily threaded loads. I have also run some other programs on the
T5140, and it is indeed over twice as fast as the G5, sometimes 3 or 4
times quicker.

Any ideas?

Cheers

Garry
Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
  #2  
Old 07-11-2008, 05:27 PM
AGT
 
Posts: n/a
Default Re: Performance anomaly on T5140

On Fri, 11 Jul 2008 09:12:04 -0700, thegman wrote:

> Today, to kill some time, I wrote some Java to make 96 threads, do
> some crypto stuff, and put the results into a Hashtable. I did this
> primarily to pass time and also to see how the T5140 performed with
> this number of threads. To compare results, I ran the same program on
> my G5 Mac. The results surprised me a bit as they were roughly the
> same. It seems odd to me that a 12 core T5140 would be about the same
> as a 2x2GHz Power Mac G5, when every benchmark I read would say that
> the T5140 would be very significantly quicker, especially under such
> heavily threaded loads. I have also run some other programs on the
> T5140, and it is indeed over twice as fast as the G5, sometimes 3 or 4
> times quicker.
> Any ideas?


Show us this java code of yours...?
maybe its not doing what you think.
Id be happy to test it on my 5120 eval..

I tested it vs, an M4000 yesterday (openssl speed -engine pkcs11 rsa)
and up to 2048 bits the 5120 beat the heck out of the M4K...

Reply With Quote
  #3  
Old 07-11-2008, 05:33 PM
thegman
 
Posts: n/a
Default Re: Performance anomaly on T5140

On Jul 11, 5:27*pm, AGT <usenetpersonger...@gmail.com> wrote:
> On Fri, 11 Jul 2008 09:12:04 -0700, thegman wrote:
> > Today, to kill some time, I wrote some Java to make 96 threads, do
> > some crypto stuff, and put the results into a Hashtable. I did this
> > primarily to pass time and also to see how the T5140 performed with
> > this number of threads. To compare results, I ran the same program on
> > my G5 Mac. The results surprised me a bit as they were roughly the
> > same. It seems odd to me that a 12 core T5140 would be about the same
> > as a 2x2GHz Power Mac G5, when every benchmark I read would say that
> > the T5140 would be very significantly quicker, especially under such
> > heavily threaded loads. I have also run some other programs on the
> > T5140, and it is indeed over twice as fast as the G5, sometimes 3 or 4
> > times quicker.
> > Any ideas?

>
> Show us this java code of yours...?
> maybe its not doing what you think.
> Id be happy to test it on my 5120 eval..
>
> I tested it vs, an M4000 yesterday (openssl speed -engine pkcs11 rsa)
> and up to 2048 bits the 5120 beat the heck out of the M4K...


No problem... There are two classes, in between the asterisks.


****

import java.util.Hashtable;
import java.util.Random;


import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.security.DigestInputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.Security;



public class Threaded extends Thread {

Hashtable _hash;
Hashtable _global_hash;

public Threaded (Hashtable hash) {

_global_hash = hash;

_hash = new Hashtable();

}


public static String crypto(String text_in) {

try {
byte[] input = text_in.getBytes();
//System.out.println("input : " + new String(input));
MessageDigest hash = MessageDigest.getInstance("SHA1");

ByteArrayInputStream byteArrayInputStream = new
ByteArrayInputStream(input);
DigestInputStream digestInputStream = new
DigestInputStream(byteArrayInputStream, hash);
ByteArrayOutputStream byteArrayOutputStream = new
ByteArrayOutputStream();

int ch;
while ((ch = digestInputStream.read()) >= 0) {
byteArrayOutputStream.write(ch);
}

byte[] newInput = byteArrayOutputStream.toByteArray();
//System.out.println("in digest : " + new
String(digestInputStream.getMessageDigest().digest ()));

byteArrayOutputStream = new ByteArrayOutputStream();
DigestOutputStream digestOutputStream = new
DigestOutputStream(byteArrayOutputStream, hash);
digestOutputStream.write(newInput);
digestOutputStream.close();

return new String(digestOutputStream.getMessageDigest().diges t());
} catch (Exception e) {
System.out.println("Exception in crypto()");
return "fail";
}
}

public void run() {

int counter = 0;

System.out.println("Started thread "+getName());

while (counter < 2000) {
Random generator = new Random( counter );

_hash.put(getName()
+String.valueOf(counter),"BLAH"+crypto(getName())) ;

counter++;

}

_global_hash.put(getName(),_hash);

System.out.println("Finished thread "+getName());


}



}

****


import java.util.Hashtable;
import java.util.Vector;




public class TestThreads {


public static void main(String args[]) {

Hashtable hash = new Hashtable();
Vector threads = new Vector();

int counter = 0;
while (counter < 96) {
Threaded t = new Threaded(hash);
t.setName(String.valueOf(counter));
t.start();
threads.add(t);
counter++;
}

counter = 0;

while (counter < 96) {
Threaded t = (Threaded) threads.get(counter);
try {
t.join();
} catch (Exception e) {
e.printStackTrace();
}
counter++;
}


//System.out.println(hash);



}

}


*****


Would be interested to see how that goes on different machines, it's
changed since the first post, now it's going much faster on the Mac...
As it stands right now, it runs in about 5 secs on the G5, and 10 secs
on the 5140, both much slower if I use -Xint, but the Mac still edges
it.

Going by my history, I've probably made a head-slapping mistake, but
we'll see...

Cheers

Garry
Reply With Quote
  #4  
Old 07-16-2008, 03:09 PM
thegman
 
Posts: n/a
Default Re: Performance anomaly on T5140

I've done more testing, and I'm wondering what sort of performance
penalty using Java threads has? I made my program take an argument of
number of threads to make, and tried running 100 threads, and then 10
processes at the same time each with 10 threads, the results are like
so:


Sun T5140 2x6x1.2GHz

-bash-3.00$ java TestThreads 100
############################################## (100 threads (9202
ms.) )

-bash-3.00$ java TestThreads 10 & java TestThreads 10 & java
TestThreads 10 & java TestThreads 10 & java TestThreads 10 & java
TestThreads 10 & java TestThreads 10 & java TestThreads 10 & java
TestThreads 10 & java TestThreads 10

############# (10 threads (2798 ms.) )
############## (10 threads (2802 ms.) )
############# (10 threads (2799 ms.) )
############## (10 threads (2866 ms.) )
############## (10 threads (2880 ms.) )
############## (10 threads (2918 ms.) )
############## (10 threads (2926 ms.) )
############## (10 threads (2918 ms.) )
############## (10 threads (2944 ms.) )
############## (10 threads (2944 ms.) )

I only make one call to a synchronized method, and that's at the end
of each thread, and extremely does very minimal work. So it would seem
that processes run much faster than threads on the T5140, which is not
terribly surprising as there must be all kinds of locks in there which
I didn't write and don't know about, but the difference is pretty big,
and also those locks would still apply on my Power Mac G5, and this
still manages pretty good performance with 100 threads:

(Power Mac G5, 2x2GHz)
################ (100 threads (3384 ms.) )

For most other multi-thread/process apps, the T5140 is a lot faster
than the G5, any ideas what's going on? I can mail anyone the source
code for my test program.

Cheers

Garry
Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
T5140 single core performance thegman SUN 6 07-29-2008 09:43 AM
telnet.exe logging in anomaly jameshanley39@yahoo.co.uk XP Networking 1 06-18-2008 06:29 AM
Windows Media Centre anomaly Ray Martin Windows Vista 1 04-17-2008 05:59 PM
Surprising Registry Anomaly? Jethro Hardware 5 10-13-2007 08:32 PM
Netflix anomaly? Bill's News DVD 5 05-16-2007 12:22 PM


All times are GMT. The time now is 08:14 AM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger