|Q: Optimising out C++ RTTI email@example.com (Nor Jaidi) (1996-12-27)|
|Re: Q: Optimising out C++ RTTI firstname.lastname@example.org (1996-12-28)|
|Re: Q: Optimising out C++ RTTI email@example.com (David L Moore) (1996-12-28)|
|Re: Q: Optimising out C++ RTTI firstname.lastname@example.org (Julian Dolby) (1997-01-02)|
|From:||Julian Dolby <email@example.com>|
|Date:||2 Jan 1997 23:16:39 -0500|
|In-reply-to:||Nor Jaidi's message of 27 Dec 1996 23:26:37 -0500|
Nor Jaidi <firstname.lastname@example.org> asked the following:
> Being a curiousity-proof cat, I have been doing some thinking about
> C++ RTTI and came to the conclusion that it is something you have to
> pay even if you don't use it. May be I am wrong. Are there any
> compiler tricks that optimise out RTTI when not used?
Other posters have noted that RTTI is "free" in the sense that the
vtable, which is required to exist anyway for RTTI to work, is
sufficient. More generally, optimizing runtime type queries requires
the same analysis as virtual function optimization -- type inference
-- because it requires the same information: concrete types.
There has, of course, been much work in type inference. I am feeling
lazy, so I will merely provide a pointer to our work --
http://www-csag.cs.uiuc.edu/papers/ti-oopsla94.ps -- the bibliography
of which can point you to other stuff.
Return to the
Search the comp.compilers archives again.