RTTI
A mechanism that dynamically determines and retrieves type information during program execution, typically implemented via virtual function tables or type pointers. RTTI provides constant-time type lookup with linear growth in code size, but introduces memory-access latency at runtime.
Timeline (last 90 days)
CTTI (compile-time type information) grows exponentially with the number of type combinations, whereas RTTI (runtime type information) is linear.
RTTI performs runtime type lookups via virtual function tables (vtables) or type pointers, and its cost is a constant-time overhead.
The constant overhead of RTTI is not zero-cost; its memory access latency and cache misses can hurt performance in performance-sensitive scenarios.
The formatting library {fmt} implements its own runtime type information (RTTI) to avoid binary bloat caused by excessive template instantiations.
CTTI is suitable for scenarios that pursue extreme runtime performance with a limited number of type combinations, while RTTI is suitable for scenarios with an explosion of type combinations and a focus on binary size.
All Facts (5)
CTTI (compile-time type information) grows exponentially with the number of type combinations, whereas RTTI (runtime type information) is linear.
50%UnverifiedRTTI performs runtime type lookups via virtual function tables (vtables) or type pointers, and its cost is a constant-time overhead.
50%UnverifiedThe constant overhead of RTTI is not zero-cost; its memory access latency and cache misses can hurt performance in performance-sensitive scenarios.
50%UnverifiedThe formatting library {fmt} implements its own runtime type information (RTTI) to avoid binary bloat caused by excessive template instantiations.
50%UnverifiedCTTI is suitable for scenarios that pursue extreme runtime performance with a limited number of type combinations, while RTTI is suitable for scenarios with an explosion of type combinations and a focus on binary size.
50%