Hyperthreading Problem

B

Brad Grier

I finally had an opportunity to test my TRS-80 Color Computer Emulator
applet on a 2.8 ghz hyperthreading Pentium 4 machine with Windows XP.
One of the games (Zaxxon) is quite CPU intensive. I was surprised to see
the program actually run much slower on this machine than my 2.0 ghz
Athlon (rated 2.4 by AMD).

When I looked at the windows performance monitor, it never posted either
of the virtual CPUs much past 50%. On my Athlon, this game goes close to
95% CPU utilization (and runs faster). Does this mean a Java program
isn't going to get as much CPU time on a non-hyperthreading CPU?

The applet is multi-threaded in that the graphics are rendered in the
event dispatch thread and the virtual 6809 CPU runs in its own thread.
Beyond that, it's pretty straightforward.

Any thoughts on this subject?

By the way, I believe the hyperthreading machine was running JDK 1.4.2.

Brad

Color Computer Applet
http://members.cox.net/javacoco/
 
B

Ben_

Hyperthreading CPUs are considered two CPUs by Windows. So, 50% CPU usage
means you'd be at 100% CPU usage if there was only one CPU.

There can be a performance gain with hyperthreading, but there can be
performance loss well (resource contention). It'd be interesting to disable
Hyperthreading and test again.
 
B

Brad Grier

Ben_ said:
Hyperthreading CPUs are considered two CPUs by Windows. So, 50% CPU usage
means you'd be at 100% CPU usage if there was only one CPU.

There can be a performance gain with hyperthreading, but there can be
performance loss well (resource contention). It'd be interesting to disable
Hyperthreading and test again.

Interesting, I don't have access to the machine at this moment. How does
one disable hyperthreading? Can you do it without going into the bios?

Brad
 
B

Brad Grier

Ben_ said:
Hyperthreading CPUs are considered two CPUs by Windows. So, 50% CPU usage
means you'd be at 100% CPU usage if there was only one CPU.

There can be a performance gain with hyperthreading, but there can be
performance loss well (resource contention). It'd be interesting to disable
Hyperthreading and test again.

It occurred to me that although the graphics run in the event dispatch
thread, it was necessary for me to synchronize these operations with the
main processor thread. Could this contention be the source of the
problem and if so, why would it be worse than on a single-cpu system?


Brad
 
B

Ben_

If you synchronize, then you serialize execution, so the two CPUs can't be
fully used. But I don't see why it would be worse with a hyperthreaded CPU
than with a single CPU.

If you're interested by hyperthreading pro's & con's, then you'll want to
read articles like:
http://www.tomshardware.com/cpu/200203131/index.html
http://www.2cpu.com/Hardware/ht_analysis/
http://www.findarticles.com/cf_dls/m0IFW/8_24/83773887/p1/article.jhtml

You'll see it's mitigated, as performance gain isn't always there.
 
E

Eric F

I finally had an opportunity to test my TRS-80 Color Computer Emulator
applet on a 2.8 ghz hyperthreading Pentium 4 machine with Windows XP.
One of the games (Zaxxon) is quite CPU intensive. I was surprised to see
the program actually run much slower on this machine than my 2.0 ghz
Athlon (rated 2.4 by AMD).

When I looked at the windows performance monitor, it never posted either
of the virtual CPUs much past 50%. On my Athlon, this game goes close to
95% CPU utilization (and runs faster). Does this mean a Java program
isn't going to get as much CPU time on a non-hyperthreading CPU?

The applet is multi-threaded in that the graphics are rendered in the
event dispatch thread and the virtual 6809 CPU runs in its own thread.
Beyond that, it's pretty straightforward.

Any thoughts on this subject?

By the way, I believe the hyperthreading machine was running JDK 1.4.2.

Take a look here ...

http://java.sun.com/docs/hotspot/

There are some options to the virtual machine that you can use to improve
performance on multi-CPU machines (which hyperthreading simulates).

Eric
 
B

Ben_

There are some options to the virtual machine that you can use to improve
performance on multi-CPU machines (which hyperthreading simulates).
Which one for example ? I don't see what options you mean.
 
D

Danny Woods

Brad Grier said:
When I looked at the windows performance monitor, it never posted
either of the virtual CPUs much past 50%. On my Athlon, this game goes
close to 95% CPU utilization (and runs faster). Does this mean a Java
program isn't going to get as much CPU time on a non-hyperthreading
CPU?

The applet is multi-threaded in that the graphics are rendered in the
event dispatch thread and the virtual 6809 CPU runs in its own
thread. Beyond that, it's pretty straightforward.

Any thoughts on this subject?

There are cases in which a hyper-threading CPU can actually perform worse
than a non-HT CPU with the same clock speed: perhaps yours is one of them.
There's a nice article that was linked from Slashdot a few days ago that
explains HT without getting too hairy:

http://www.2cpu.com/articles/ht_explored/index.html

The basic upshot is that the two virtual CPUs are not real CPUs and share
the same cache. If the processes on the two VCPUs are completely separate
from each other, they may compete over the cache and possibly hinder
performance.

I don't know if this is related to your problem, but it's something I
thought was worth mentioning when I read your post.

Regards,

Danny.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top