Repository navigation
perf(runtime-tags): return the side of a sorted union that holds the other - #4522
Conversation
…other A union of two sorted lists returned an input only when both held the same items, and built a copy whenever one held the other. Reasons only grow, so most merges in the reasons solve add nothing, yet each one allocated and re-ran the param alias filter, whose `merged === a` shortcut almost never fired. In deeply nested `<if>`s that filter dominated the compile. A union now returns the side that already holds the other, as `filter` and `difference` return their input when nothing drops. `a`'s item still wins a tie, so `b` stands for the union only where it holds `a`'s very items. Compiled output is unchanged. On the bundled build, a template nesting `<if>` 50/100/200 levels deep compiles 35%/48%/58% faster; the fixtures compile within noise. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4522 +/- ##
=======================================
Coverage 94.86% 94.86%
=======================================
Files 419 419
Lines 20902 20906 +4
Branches 4173 4176 +3
=======================================
+ Hits 19828 19832 +4
Misses 617 617
Partials 457 457 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The reasons solve merges sorted sets on every pass, and since reasons only grow, most of those merges add nothing.
unionstill built a copy whenever one side already held the other, so each no-op merge allocated and re-ran the param alias filter, whosemerged === ashortcut almost never fired. In deeply nested<if>s that filter dominated the compile.unionnow returns the side that already holds the other, the same identity rulefilteranddifferencefollow;a's item still wins a tie. Compiled output is unchanged. On the bundled build,<if>s nested 50/100/200 levels deep compile 35%/48%/58% faster, and the fixtures compile within noise.🤖 Generated with Claude Code