News for hackers. Stuff that matters.
Re:Flags Are a Code Smell (2014) by tbrownaw on Sunday May 22, 2022 @01:26AM (#31465116)
Function pointers / vtables / polymorphism are slow, because they're indirect jumps (harder to predict). Function calls are slow, because there's work to do to save / restore state on the stack.

These don't matter much for big heavy functions, but tiny ones can seriously benefit from being inlined.

I have heard elsewhere that "game objects are just an index into a bunch of arrays for all the object properties" is fairly common practice, but well I don't write games myself.

There are no comments on this comment yet.