Commit c5825fc
Locator.clickable.wide and field.labelContains emit predicates of form
[@aria-labelledby = //*[@id][normalize-space(string(.)) = 'X']/@id ].
xpath@0.0.34 re-runs the inner //* scan once per outer element match —
O(N²) on non-trivial docs. The 2k-line github fixture spent 8.5s in
that single branch out of 12.
Pre-resolve the inner subquery once, splice the resulting id (or a
sentinel for no-match) back as a literal so the engine sees a flat
attribute compare.
Github 'Sign up' --click: 9026ms → 276ms (~33×).
Full runner suite: 14s → 6s.
Reverts the 30s describe-level timeout from the previous commit since
the underlying perf issue is now fixed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent db7c7e8 commit c5825fc
2 files changed
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
121 | 140 | | |
122 | 141 | | |
123 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 48 | + | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
0 commit comments