Commit e023225
feat(rule): gate sync rule-result resolution behind runTypeASync flag
Resolving each rule's result via setTimeout(0) (Deque #1172) creates one
macrotask transition per rule (~335). On large DOMs with advance ON these
interleave with DevTools IPC (resource.getContent), ballooning the
per-rule resolve from ~8ms to ~180ms and inflating axe.run from ~14s to
~85s.
When axe._cache 'runTypeASync' is set (by a11y-engine-core run.js from the
a11yCoreConfig flag), resolve synchronously to eliminate the contention.
The flag defaults OFF, preserving the original deferred behaviour.
On the OFF path, instrument the schedule-to-fire delay of each yield and
accumulate {totalMs,count,maxMs} onto axe._typeASyncYield so every scan
reports how much wall-clock the async resolve costs — the exact time the
flag would recover. Read back into Type A telemetry by a11y-engine-core.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0371a36 commit e023225
1 file changed
Lines changed: 32 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
315 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
318 | 346 | | |
319 | 347 | | |
320 | 348 | | |
| |||
0 commit comments