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.
18 lines
306 B
Makefile
18 lines
306 B
Makefile
# testcafe patch test + bench runner
|
|
|
|
PYTHON := python3
|
|
TEST_FILE := tests/test-testcafe-cwe407.py
|
|
BENCH_DIR := bench
|
|
|
|
.PHONY: all test bench clean
|
|
|
|
all: test bench
|
|
|
|
test:
|
|
$(PYTHON) $(TEST_FILE)
|
|
|
|
bench:
|
|
$(PYTHON) $(BENCH_DIR)/run_all.py
|
|
|
|
clean:
|
|
rm -rf tests/__pycache__ bench/__pycache__ __pycache__
|