[KongchangAI]
ConceptRun-Time Type Information / 运行时类型信息

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)

Sep 12

CTTI (compile-time type information) grows exponentially with the number of type combinations, whereas RTTI (runtime type information) is linear.

Unverified50%
Sep 12

RTTI performs runtime type lookups via virtual function tables (vtables) or type pointers, and its cost is a constant-time overhead.

Unverified50%
Sep 12

The constant overhead of RTTI is not zero-cost; its memory access latency and cache misses can hurt performance in performance-sensitive scenarios.

Unverified50%
Sep 12

The formatting library {fmt} implements its own runtime type information (RTTI) to avoid binary bloat caused by excessive template instantiations.

Unverified50%
Sep 12

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.

Unverified50%

All Facts (5)

Source Articles