This content has been marked as final. Show 6 replies
During this lag, is there IO going on? If you want to check just the drawImage load a several (or all) of the images you are using and rotate through them, this will give you an idea if you are having some display problem.
More likely you are hitting some Windows virtual memory action, System blocking due to IO, or the Java GC--btw, due to the patter you show, I would not expect the Java GC.
I tried drawing just one image but it didn't really change anything. (it were only 3 different images to start with)
Memory usage is only at about 30MB, however the CPU usage is close to 100%.
Do you know any way to test if it is a problem with Windows virtual memory?
edit: what also confused me is the fact that the javadoc of drawImage says the function returns imediately.Doesn't that mean that there should be almost no wait at all?
Edited by: D3fe4t on Jun 1, 2010 8:19 AM
The granularity of System.currentTimeMillis() on Windows is around 16 ms. That explains your results.
So that means, that the time is not in fact 0ms or sometimes 16ms but rather somewhere inbetween and Date().getTime() simply doesnt use the exact time in windows.
So I'm still stuck with my performance problem but at least it's a little less weird...
You can try System.nanoTime(), just remember a nanosecond is about as long as it takes electricity to travel 1 foot--it's not a significant time for measuring most events, but 1,000,000 nanoseconds is equal to 1 millisecond.
Yeah, I'm using a more accurate measurement system now and the time required was pretty constant.
I tried installing installing new graphic drivers and surprisingly it helped. The program now runs a lot smoother although i had the ati driver from last june until now, which shouldn't be that bad. There might also have been some special problem with the drivers.
Anyway it works now so thanks everybody!