You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
citry check's Vue compile grows faster than template depth #501
citry check compiles each component's template with the Vue compiler to report Vue's own errors (_compile in packages/py/citry/citry/_vue_compile_lint.py:308, which calls _rust.vue._compile_vue). On deeply nested templates that compile grows faster than the depth: about 3 times as long each time the depth doubles.
Measured with cProfile on CPython 3.14.9, a debug build of citry_core, one component checked with check_project:
After #384 (perf/shared-ast-children), the rest of the check grows close to linearly, so this compile is now most of the check's time on these templates: about half at 256 levels. The times are still well under a second at the nesting limits, so nobody hits this as a slow check today. This issue records where the remaining growth is.
A smaller cost grows with the square of the depth too: line_break_count (packages/py/citry/citry/_source_lines.py:30) is called once per node, 1,024 times for the c-elif template at 256 levels, and took 0.027 s there.
Fix direction
Profile _compile_vue on these templates in a release build, find the pass whose cost grows faster than the depth, and make it linear. The compiler's output must not change; the Vue compile-lint tests cover that. If the release build already grows linearly, close this issue.
The checker's line lookup and the step-by-step site-id hashing landed in #538. The remaining two changes are tracked as v1.1 issues: #537 (parent indices in the compiler output) and #536 (cap the indentation).
Activity
perf(vue): hash each element's site id from its parent's hash state
perf(check): find a source's line starts once for all its findings
JuroOravec commentedon Oct 28, 2026
The checker's line lookup and the step-by-step site-id hashing landed in #538. The remaining two changes are tracked as v1.1 issues: #537 (parent indices in the compiler output) and #536 (cap the indentation).