Commit 47695db
Remove parent-chain cycle detection from ScopeMap constructor
The cycle detection allocated a HashSet and walked the full parent chain
on every new Context (i.e. every enterScope in for loops). This was a
defensive check added long ago but is not needed in normal operation and
causes measurable overhead in hot template rendering paths.
Benchmark: +37% throughput on complexTemplateBenchmark (3,316 -> 4,542 ops/s)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1c0d59c commit 47695db
1 file changed
Lines changed: 0 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | | - | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | | - | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
| |||
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 24 | | |
48 | 25 | | |
49 | 26 | | |
| |||
0 commit comments