Migrated from GitLab issue #160
Originally created: 2026-03-13
Closed: 2026-03-22
Author: Kris Simon
Problem
Every Transform the <x> from the <template: name.screen> call reads and re-parses the template file from disk. In a tight render loop (e.g. TUI refreshing 10×/s) this is wasteful I/O and CPU.
Fix
Cache parsed Template objects keyed by file path. Invalidate the cache entry when the file's mtime changes (stat the file, compare mtime before re-parsing). In production builds, cache unconditionally.
Files
Sources/ARORuntime/Templates/TemplateExecutor.swift
Problem
Every
Transform the <x> from the <template: name.screen>call reads and re-parses the template file from disk. In a tight render loop (e.g. TUI refreshing 10×/s) this is wasteful I/O and CPU.Fix
Cache parsed
Templateobjects keyed by file path. Invalidate the cache entry when the file'smtimechanges (stat the file, compare mtime before re-parsing). In production builds, cache unconditionally.Files
Sources/ARORuntime/Templates/TemplateExecutor.swift