Game Development Community

Abstract Classes

by William Finlayson · in Technical Issues · 12/09/2001 (2:04 am) · 2 replies

I'm in the middle of programming a high-level 2D engine. I'm using abstract classes as the interface for the user, and hiding the real classes in a DLL. I was just wondering if using abstract classes gives a big performance hit or not. I read somewhere that late-binding was a lot slower then early binding, but by how much?

#1
12/09/2001 (8:58 am)
The performance penalty for calling virtual functions is almost negligible; it involves a whole pointer-dereference. That being said, you should still avoid calling them within tight loops. On the whole, though, they're the least of your concerns when it comes to optimizing an entire project.
#2
12/10/2001 (12:34 am)
Thats great thanks! I was worried I'd have to scrap it and start over...