views:

146

answers:

1

In follow-up to my previous questions (especially this one : http://stackoverflow.com/questions/2684123/java-volatileimage-slower-than-bufferedimage), i have noticed that simply drawing an Image (it doesn't matter if it's buffered or volatile, since the computer has no accelerated memory*, and tests shows it's doesn't change anything), tends to be very long.

(*) System.out.println(GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getAvailableAcceleratedMemory()); --> 0

How long ? For a 500x400 image, about 0.04 seconds. This is only drawing the image on the backbuffer (obtained via buffer strategy).

Now considering that world of warcraft runs on that netbook (tough it is quite laggy) and that online java games seems to have no problem whatsoever, this is quite thought provoking.

I'm quite certain I didn't miss something obvious, I've searched extensively the web, but nothing will do. So do any of you java whiz have an idea of what obscure problem might be causing this (or maybe it is normal, tough I doubt it) ?

PS : As I'm writing this I realized this might be cause by my Linux installation (archlinux) tough I have the correct Intel driver. But my computer normally has "Integrated Intel Graphics Media Accelerator 950", which would mean it should have accelerated video memory somehow. Any ideas about this side of things ?

+1  A: 

I don't know much about java graphics, but if I were in your shoes, I would assume that the measurement means nothing without a comparison value, which it sounds like you might have but are not sharing. Add this information to your question, along with the specs of the comparison system (is it a desktop? does it have a dedicated video card? does it run windows or linux?).


Concerning your measurement that it's 10 times faster on another netbook, does that other notebook run Windows, or is that one also Linux? Linux has historically had very mediocre graphics drivers - they just don't run nearly as well as the Windows equivalents. In fact for a long time the only drivers you could get were not written by ATI/nVidia/etc., but rather by hobbyists. It would not surprise me at all if a Linux machine ran a graphical program ten times slower than a similar machine running Windows.

This was the situation as I understood it about five years ago. I doubt it's changed much.

Chris
We can do some calculations. 500x400/0.04 is 5,000,000 pixel/second. That is going to be a read and a write of presumably 32 bits each. I'd be disappointed if a twenty year old (non-PC) desktop couldn't manage that.
Tom Hawtin - tackline
What about looking at existing games which use complex Java2D operations? I'd recommend the stuff on http://goldenstudios.or.id/products/games/index.php as perhaps a benchmark :)
Chris Dennett
@Chris : See my answer to camickr above for comparison values. || @Tom : My own calculations told me the same :) || @Chris : I looked it up some time ago, but there seems to be no magic trick of the sort I seek there. Actually I'm now about 99% the fault is in the OS camp. I have opened a thread on the archlinux forums, with no success so far.
Norswap
Ubuntu Netbook Edition, 9.10 (Karmic Koala) I think. Btw, Intel makes quality open source driver, which support graphical acceleration. I've looked around and found no one who had comparable problems - it definitely seems to be my system, because glxgears (a linux 3D benchmark) gives me 60fps, which is really low (people with my netbook usually report about 300-400).I have found one or two things to try, but I highly doubt they'll work :s
Norswap