Re: Q: Optimising out C++ RTTI

Julian Dolby <>
2 Jan 1997 23:16:39 -0500

          From comp.compilers

Related articles
Q: Optimising out C++ RTTI (Nor Jaidi) (1996-12-27)
Re: Q: Optimising out C++ RTTI (1996-12-28)
Re: Q: Optimising out C++ RTTI (David L Moore) (1996-12-28)
Re: Q: Optimising out C++ RTTI (Julian Dolby) (1997-01-02)
| List of all articles for this month |

From: Julian Dolby <>
Newsgroups: comp.compilers
Date: 2 Jan 1997 23:16:39 -0500
Organization: Compilers Central
References: 96-12-179
Keywords: C++, performance
In-reply-to: Nor Jaidi's message of 27 Dec 1996 23:26:37 -0500

      Nor Jaidi <> 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 -- -- the bibliography
of which can point you to other stuff.

Julian Dolby

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.