java-topology/defects/testcafe/bench/results.txt
russell@unturf.com b79fddfb51 browser-automation wave 2: testcafe-0001 + webdriverio-0002
testcafe-0001: Selector filterNodes (string-filter branch) and
  expandSelectorResults both dedup via Array.indexOf on growing result
  arrays. filterNodes: O(N*M) per selector filter. expandSelectorResults:
  O(N^2 * K^2) worst case when derivatives unique. Fix: Set<Node> keyed
  by object identity. Bench: 398x at N=2000 filter, 1966x at N=K=150
  expand.

webdriverio-0002: MSPO aggregator dedups per-test entries via Array.find
  on growing bucket array. O(N^2) per test bucket, same pattern repeats
  in unknown-suite merger. Fix: companion Map<bucketKey, Set<selector>>
  for O(1) dedup. Bench: 493x at N=2000.

UNDF IDs: 1290 (testcafe), 1291 (webdriverio-0002). All 17 tests pass.
2026-04-22 18:31:53 -04:00

11 lines
698 B
Text

=== testcafe-0001 filterNodes: indexOf vs Set.has ===
N=100 M=50 : defective=0.073ms fixed=0.005ms speedup=13.5x
N=500 M=250 : defective=1.771ms fixed=0.025ms speedup=71.8x
N=1000 M=500 : defective=6.117ms fixed=0.040ms speedup=151.9x
N=2000 M=1000 : defective=30.280ms fixed=0.076ms speedup=398.1x
=== testcafe-0001 expandSelectorResults: indexOf vs Set.has ===
N=20 K=20 (total 400): defective=1.178ms fixed=0.030ms speedup=39.3x
N=50 K=50 (total 2500): defective=49.165ms fixed=0.154ms speedup=319.2x
N=100 K=100 (total 10000): defective=934.917ms fixed=0.644ms speedup=1451.3x
N=150 K=150 (total 22500): defective=4985.195ms fixed=2.535ms speedup=1966.5x