Original Post
I'm creating an RTS.. Now, in a worstcase scenario, I'll have 100000+ units/buildings/other things that needs to update.. Chanses are pretty big they'll have very much in common, and that 95% of them will use the save moves and stuff, but a few will need special code.. So I was thinking about a baseclass with virtual methods, and the default stuff coded there, and then the special ones would overload it.. It's also not completely impossible that I can live without those 5% with special code (at the moment I'm not really sure for what it could be used, but I think there could be cases).. My question is, would it affect my performance much to use a virtual method instead of a normal one? And take in to account that all my units/buildings must update on each frame, at a framerate of 50fps.. So my question is: How much slower is virtual methods when used in a pretty large scale?