Java performance differences between linux and windows

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
I've written a program that does validation and QA with DICOM images. Part of the program displays the images in a JPanel and the user can scroll through the set by slider, mouse wheel, etc... Also, the user can dynamically change the image's window width and centers with sliders as well as vertical and horizontal mouse drag events on the panel. Window width and centers can be visually likened to brightness and contrast, but...different. It's more to do with other information stored inside the file header.

Each redraw or scrolling requires re-accessing the file to create a new BufferedImage. On linux, this is instantaneous. Windows, OTOH, has to chug along step by step by step for any redraws/scrolls.

I assumed the performance difference came form Linux caching recently accessed files in memory (from prior methods for other purposes), and Windows must be accessing the HDD for each operation.

So I tried creating a Vector of BufferedImages (rendered with default widths and centers), so it should be quick access from memory. However, Windows still chugs along slowly when scrolling through the default images.

So...I'm not sure what to do. How can I make it butter-smooth in Windows, as it is in Linux?
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Well, in case anyone has a similar problem, the issue was Java's default use of Direct3D for 2D graphics drawing on Windows. Adding -Dsun.java2d.noddraw=true to the shortcut command solved it.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Interesting. That might mean that Java performs better on Vista since the DWM uses Direct3D to compose desktop elements.

Thanks for taking the time to follow up and post the resolution.
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Originally posted by: Markbnj
Interesting. That might mean that Java performs better on Vista since the DWM uses Direct3D to compose desktop elements.

Thanks for taking the time to follow up and post the resolution.

Actually, I did try the program on my home computer and it was just as slow as my workstation.

Workstation: Dell Optiplex 740 - XP Pro/sp3 x32, AMD64 X2 5600+, 1GB RAM, integrated nvidia Quadro NVS 210s (updated drivers)
Home PC: HP m9077c: Vista HP x64, Intel Q6600, 3GB RAM, dedicated nvidia 8500GT (updated drivers)

Since DICOM images aren't simple jpegs, png, tiff, etc. images (though jpeg compression can be encapsulated), I have to use the JAI ImageIO tools. It might have something to do with that.