Is there any real overhead associated with InvokeRepeating? I have something that runs in Update that I can easily get away with updating, say, 30 times per second instead of every single frame (which in most scenarios means it's being run about 150 times per second; which seems like I have a lot of excess frames to work with, but I'm making a physics game so I need to squeeze out as much performance as possible).
Keep in mind this is for simple "update counter text" type things, so the function itself that is being repeated isn't heavy, but I'm trying to maximize speed and wondering if InvokeRepeating has any inherent performance hits.
If there aren't any problems, I'm going to happily start migrating a bunch of things out of Update, where it seems wasteful to do them every single frame when there's no need.
Also, is there any difference between using coroutines and InvokeRepeating in terms of performance?
asked Nov 28 '11 at 07:12 PM
In terms of overhead, the order (from most to least) is Update, coroutines, then InvokeRepeating.
answered Nov 28 '11 at 07:48 PM