Original Post
🔒 Locked
RTTI
Advertisement
I use it quite a bit in the game I''m working on. The scripting engine allows storing a pointer with script-objects. I use RTTI to determine what kind of game-object this corresponds to. There can be quite a few RTTI calls in that area and I haven''t measured any performance drop. That doesn''t mean there isn''t any, but compared to the rest of the processing necessary for the game, it''s negligable. (Using MSVC6Pro, BTW)
But if you need RTTI a lot to determine actions in your program, I''d say you need to rework your design instead.
But if you need RTTI a lot to determine actions in your program, I''d say you need to rework your design instead.
With processors as fast and as underworked as they are nowadays, the extra redirection that RTTI requires should in most cases have a negligible effect on your game''s performance. If you are using RTTI in an inner loop that needs to be aggressively optimized, however, you might want to worry about it a little bit.
You won''t now for sure what effect RTTI has on performace until you actually do it, and profile it; there are far too many variables for a generalized answer to be useful. Give it a try.... tell us how it works out.
You won''t now for sure what effect RTTI has on performace until you actually do it, and profile it; there are far too many variables for a generalized answer to be useful. Give it a try.... tell us how it works out.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement