How strange.
So there I was cunningly testing the Steam build of Revenge of the Titans when I noticed the game lagging periodically - down to 50fps for a second and then back up to a rock steady 60fps. This is odd, I thought. Maybe it’s because the Steam build uses JRE6 server VM. Nope, does the same with the client VM. Maybe it’s because I’m not using the G1 GC (using -Xincgc instead). Nope, -verbose:gc shows I’m not collecting any garbage when the pauses happen.
So I stuck at it for half an hour, playing the game, and then I just let it run on a large empty survival map for a while with a few turrets, and didn’t touch anything. And there were no odd slowdowns as I watched. But as soon as I starting shoving the mouse around, scrolling and such with it - there’s the slowdown again. Whaa? My scrolling routines must be doing something wrong… so I checked using the keys to scroll (WASD or cursor keys if you didn’t know). And… no slowdown. Oh. So it’s not the scrolling. Must be some bit of mouseover code that’s slow then. So I put the mouse pointer in the middle of the action and scrolled around using the keys again making the mouse go over all sorts of different objects bringing up effects and so on … nope. No slowdown. I wiggle the mouse. Game slows down.
WTF!
And it happens in JDK7 - barely. But why do we think this is happening at all, eh?
This is JDK6 32-bit, on a Vista64 system with a quad core i7 running at 2.6Ghz and some graphics card that’s so fast it’s already calculated the recipe for rice pudding.
I am perplexed! Anybody else notice this behaviour? Is it JInput? Java? LWJGL?
Cas 