Skip to content

cmGeneratorTarget: Cache property evaluation results

This change aims to improve property evaluation performance by avoiding recursive visits into target dependencies as much as possible.
Two caches are added to cmGeneratorTarget: one stores only local property values (i.e. not including transitive values from dependencies), the other one stores only transitive values.
The cache keys are (property name, language) pairs. Only values that are independent from the config and head property are stored in caches.

This may change the order and number of occurrences of values in CMake outputs, but I haven't found cases where the set of outputted values is actually different.

I've measured the performance improvements on a very large CMake project:

Calls to cmGeneratorTarget::EvaluateInterfaceProperty(Recursive) Total Generate time
Without change 173,184,545 358s
With change 2,327,437 249s

Merge request reports

Loading