Skip to content

test: drop wall-clock search-engine benchmark tests - #267

Merged
arzafran merged 1 commit into
mainfrom
test/drop-search-benchmarks
Aug 6, 2026
Merged

test: drop wall-clock search-engine benchmark tests#267
arzafran merged 1 commit into
mainfrom
test/drop-search-benchmarks

Conversation

@arzafran

@arzafran arzafran commented Aug 6, 2026

Copy link
Copy Markdown
Member

What this does

Removes two performance-benchmark tests from CommandPaletteSearchEngineTests.swift that were burning 36.2 seconds — 27% of the entire unit suite's measured test-body time (132s total) — while asserting nothing about correctness. They compared elapsed milliseconds of the optimized search against a hand-rolled linear-scan "reference" pipeline with a 1.25x margin, which is also a CI-load flakiness risk on shared runners (timing assertions can trip under noisy neighbors).

Summary

  • Deleted testCommandSearchBenchmarkBeatsLegacyPipeline and testSwitcherSearchBenchmarkBeatsLegacyPipeline (were at lines 831/870).
  • Deleted their benchmark-only helpers benchmarkElapsedMs and repeatedQueries — used by nothing else in the file.
  • Correctness coverage is unchanged: testOptimizedSearchMatchesReferencePipeline already asserts the optimized search matches the reference pipeline's results, for both the command and switcher corpora, across 9 queries — this is the coverage the benchmarks' _ = ... discarded-result calls never actually asserted on.
  • Added a one-line pointer in the file header: search-engine timing/throughput is measured out-of-band via tests_v2/test_cpu_occlusion_throttle.py / docs/cpu-harness.md, not in the unit suite.
  • Chose deletion over XCTSkip: a skipped test still compiles, and the audit found the dominant CI cost here is xcodebuild compiling ~46K lines of test source (~9 of the job's ~10.5 minutes), not test execution — so this is a first cut at trimming volume, not a claim of large wall-time savings from these two tests alone.

Test Plan

  • xcodebuild -project GhosttyTabs.xcodeproj -scheme programa-unit -configuration Debug -destination 'platform=macOS' test -only-testing:programaTests/CommandPaletteSearchEngineTests → 24/24 tests pass (was 26 before), suite executes in 0.424s (down from 36.67s aggregate previously attributed to this suite).

testCommandSearchBenchmarkBeatsLegacyPipeline and
testSwitcherSearchBenchmarkBeatsLegacyPipeline only asserted
XCTAssertLessThan on elapsed milliseconds against a hand-rolled
reference scan — no result-correctness assertions, and the
optimized-vs-reference result equivalence they exercised is already
covered by testOptimizedSearchMatchesReferencePipeline in the same
file. Together they were 36.2s (27%) of measured unit-test body time
and a CI-load flakiness risk (1.25x margin on shared runners).

Removed the two tests plus their benchmark-only helpers
(benchmarkElapsedMs, repeatedQueries), which were used by nothing
else. Added a one-line pointer to the out-of-band performance harness
(tests_v2/test_cpu_occlusion_throttle.py, docs/cpu-harness.md).
@arzafran
arzafran merged commit b38305e into main Aug 6, 2026
10 checks passed
@arzafran
arzafran deleted the test/drop-search-benchmarks branch August 6, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant