Touches are slowing down game

I've got my game running quite nicely, but everytime I touch the screen (or move fingers on screen etc), it slows the game down. I'm testing on hardware, on an iPhone 2g device. I tried in release and in debug mode; and also 3.1.2 and 3.1.3.

I seem to recall seeing that happening too. Even if I wasn't catching and using the touch events, I could quite measurably increase the CPU usage of my game by wiggling my finger around on the screen. IIRC it was something like 5-10%. Given that I wasn't doing anything with the events, I really just assumed that there was nothing more that I could do about it and moved on.

Same conclusion as Skorche. All you can really do is tune your animation loop to ensure the event loop can "breathe". Blocking too much can cause events to queue up in bunches and make things even worse.

Not sure what you mean by blocking events (bit of an iPhone newbie to be honest). I'm not really doing much though, on touchesBegan/Moved/Ended etc; just storing the touch data (which I use elsewhere, later).

I tried running my game at 30hz, which I can't notice any slow-down from the touches, but then of course, the animation is slightly 'blurred'. That's on am iPhone 2G though, which I think may be the lowest powered device there is?

I think the system processing the touches, may just push the amount of processing per frame, over the edge (and so it drops out of 60hz).

I may end up running at 30hz on a 2g and 60hz of 3g or 3gs. Guess it depends on the relative processing power of the devices.

There's also a good chance I don't know what I'm talking about; again, I'm very much an iPhone newbie.

If you use too much CPU on the iPhone it sometimes stops sending touch events to your app. Then after storing them up for 10-20 seconds it sends them all in one big lump. I've noticed it in my games and in other peoples games. It seems that there isn't really anything you can do about it other than to add some extra wait times into your game loop so the CPU idles for a few milliseconds once in a while and lets whatever part of the OS that sends the touch events to catch up.

You can't do much about it. Processing touches takes CPU time, and this happens somewhere on iPhone OS. You can't control that. There are ways to limit the time frame given for it, but you'd need to rewrite your game loop to run it manually (google more info about NSRunLoop). And it's not advised, because limiting time on it can ruin responsiveness. Just make sure it's not having a huge impact on gameplay experience and you'll be ok.

Game is running smooth @ 60hz now, thanks to the CADisplayLink thingy. Before I was just using NSTimer, which I think it begins putting the backbuffer frame together at any point during the current display refresh (rather than at the start of the current display refresh). So the OS processing the touches was just pushing it over the edge. Or at least, that's my best guess / explaination.