Skip to main content

HyperThreading mess up Java 3D picking

3 replies [Last post]
oldhare
Offline
Joined: 2004-06-28
Points: 0

Hi, All,

Here is the problem:

We have multiple machines in Windows XP that has intel P4 2.8G Hz+ CPU with
Hyper Threading enabled. We found Java 3D picking action become very slow,
even slower than machines with less than 1G Hz CPU. The
pickCanvas.pickAllSorted() method is taking more than 10 times its original
time.

After we disable Hyper Threading in BIOS, everything becomes normal again.
Anyone has similiar experience? Is this a Windows XP problem or Java 3D
problem? We have the latest version of Windows XP professional.

Thanks!

Hong

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Matthew Hilliard

An addendum. Because you're calling pickAll() on the canvas, you'll be
traversing EVERY leaf Node on the graph to find the set with a bounding
boxes close to the PickShape.

The pickAll() call is still where 4/5 of the work for my own HT hack still
happens, and the reason is most j3d operations are CPU-bound in a
CPU-deprived environment. If you can reduce the pickAll() to a subset of
the Nodes or use setPickable(false) wherever possible (the default is
true), the performance on my own app got significantly better, having done
just this.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

mstrasse
Offline
Joined: 2004-07-01
Points: 0

This sounds quite unusual - I confess that I have no experience with picking on machines that support HyperThreading.

Have you tried re-enabling HyperThreading in the BIOS and see if the performance problem returns? Have you tried picking on another machine with HyperThreading to see if the same behaviour occurs?

For us to be useful to you, you also need to post more details of your environment:
o Java3D version number and type (OpenGL/DirectX)
o JVM version (java -version)
o version of XP (Service Pack number)
o amount of RAM, processor speed, motherboard
manufacturer and type, and video card

(Note that running NetMeeting might cause serious performance degradation when using the DirectX version of Java3D - try running 'dxdiag' and see if it complains about NetMeeting upon startup)

-Mark

Matthew Hilliard

I have an assumption about this, which may help tracking down the problem.

What I've found on my own p4 @2.8GHz, j3d collisions and picking are
*extremely* CPU-bound (painfully so, actually), especially those with large
scene graphs where every Node has to be tested, and then potentially
sorted--ironically including those with setCollidable(false).
Now, 1.4 JVMs are only entitled to use 1 of the 2 Hyper Threads, so unlike
other native threads, essentially you're depriving your app of 50% of its
CPU when you have HT enabled. Adding a CPU-bound operation to a
multithreaded environment like j3d and then depriving the CPU of 1/2 its
potential cycles will undoubtedly cause a serious performance hit.

My own work-around for HT machines has been to drop the PickTool with
extreme prejudice (spawning a new PickResult every pick appears to perform
better than using PickTool) and calling pickAll() (or pickAllSorted() in
some cases has also been helpful) from the BranchGroup I would have passed
to the PickTool and then performing a Node culling operation on the
SceneGraphPath[] using the getObject() of each to ensure that Nodes I DON'T
want picked aren't involved with PickIntersection testing don't run up the CPU.
I found on the project I'm currently working on, doing this every frame
saved me somewhere between 40 and 60% CPU load when I perform a pick on a
small set of Shape Nodes across a very large, and dense scene graph,
instead of using PickTool on HT machines. Knowing nothing about your
graph, your mileage may vary.

Just my $0.02

Matt

At 12:05 PM 7/7/2004, java3d-interest@javadesktop.org wrote:
>This sounds quite unusual - I confess that I have no experience with
>picking on machines that support HyperThreading.
>
>Have you tried re-enabling HyperThreading in the BIOS and see if the
>performance problem returns? Have you tried picking on another machine
>with HyperThreading to see if the same behaviour occurs?
>
>For us to be useful to you, you also need to post more details of your
>environment:
> o Java3D version number and type (OpenGL/DirectX)
> o JVM version (java -version)
> o version of XP (Service Pack number)
> o amount of RAM, processor speed, motherboard
> manufacturer and type, and video card
>
>(Note that running NetMeeting might cause serious performance degradation
>when using the DirectX version of Java3D - try running 'dxdiag' and see if
>it complains about NetMeeting upon startup)
>
>-Mark
>---
>[Message sent by forum member 'mstrasse' (Mark Strasser)]
>
>http://www.javadesktop.org/forums/thread.jspa?messageID=15483㱻
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
>For additional commands, e-mail: interest-help@java3d.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net