RE: [GD-General] Overhead of RTTI
Brought to you by:
vexxed72
From: Grills, J. <jg...@so...> - 2002-12-24 13:49:48
|
I think it somewhat depends on your compiler. Two of the larger profile spikes in a Win32 compile (using MSVC 6) of one of our applications right now are caused by excessive use of dynamic_cast. I spent some time looking at the code dynamic_cast created, and it's ugly. It even does string compares internally, which is completely gross. For places where performance matters, we are adding a "virtual Derived * asDerivedClass()" function which returns NULL in the base class and "this" in the Derived class. Tracking down inappropriate frequent callers of dynamic_cast can be pretty tedious as well. GCC's code gen for this stuff is apparently a fair bit better. j -----Original Message----- From: Tom Forsyth [mailto:to...@mu...] Sent: Tuesday, December 24, 2002 7:02 AM To: gam...@li... Subject: RE: [GD-General] Overhead of RTTI It's usually far quicker and easier to code it yourself with a few helper functions, unless you actually need the full madness of RTTI. Tom Forsyth - Muckyfoot bloke and Microsoft MVP. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Adrian Cearnau [mailto:ce...@ce...] > Sent: 24 December 2002 12:50 > To: gam...@li... > Subject: [GD-General] Overhead of RTTI > > > Hey everyone and merry X-Mas, > > I'd like to know what the realistic overhead of enabling RTTI in a C++ > project is. Any opinions are welcome. > > Thank you, > Adrian 'cearny' Cearnau |