Android lag when home key is pressed

My 2d game runs smooth most of the time on my gs3 but when I press the home key or the lock button (anything that makes the application pause in the android system) the phone gets very stuttery. It goes away after a few minutes but its very annoying. Of course the game is also laggy if it’s resumed after being paused by the system.

I originally thought it was a problem with Time.realTimeSinceStartup but I’ve removed most of those lines of code and it doesn’t seem to have helped. Any clue as to why this is happening is much appreciated

Just revisiting this old question. I eventually determined that it was a problem with CyanogenMod as it worked when I reinstalled a touchwiz rom on my gs3. I’ve since reinstalled CyanogenMod and everything works fine as long as you uncheck use 32 bit display buffer.