Talk:ZScript functions

From ZDoom Wiki
Jump to navigation Jump to search

Performance Hit stuff

I dunno, I've not seen this much unless you're calling hundreds of functions per tic and amounting to several thousand VM instructions per tic. I feel this needs clarification.

Re: performance note

I was just trying something out today, calling the exact same instructions through a subfunction and then explicitly, after 100,000 calls of another set of calculations.

With the subfunction I got my framerate down to ~1160-70 ms per frame. With the explicit call I got it down to ~1155-60 ms.

This is a single actor with one call per tic (the 100,000 being some other stuff).

It could add up for more complex matters (which would be the ones calling for more subfunctions to begin with).