Commit 44182f9
committed
perf(template-no-unsupported-role-attributes): pre-index elementRoles by tag (Copilot review)
Benchmarked ~2.6× speedup on getImplicitRole — bucketing the static
elementRoles Map by tag turns the per-call scan of ~80 keys into a 1-5
key lookup per tag. Parity verified across 15 representative tag/attr
combinations before landing. Matches the Q29 optimization pattern on
#51's isSemanticRoleElement.1 parent 204976a commit 44182f9
1 file changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
45 | 63 | | |
46 | 64 | | |
47 | 65 | | |
| |||
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
60 | 82 | | |
61 | 83 | | |
62 | | - | |
| 84 | + | |
63 | 85 | | |
64 | 86 | | |
65 | 87 | | |
| |||
0 commit comments