sylva-units: optimization , cache unit-def results to reduce repeated template interpretation
https://gitlab.com/sylva-projects/sylva-core/-/merge_requests/7492 introduced $all_dependencies_cache to memorize dependency chain across units. A similar pattern can be applied to unit-def calls, which are currently re-computed on every call with no caching.
Each unit-def call:
- Merges unit_definition_defaults + all unit_templates entries + the unit's own definition via merge-append
- Runs interpret-inner-gotpl over the merged result
This is expensive and redundant for repeated calls on the same unit
issue