This repo uses the SwiftSoupProfile executable for performance checks.
- Always compare release builds on the same machine.
- If an optimization has a runtime or compile-time flag: run with flag OFF and ON.
- If there is no flag: compare HEAD to a baseline commit in a worktree.
- For each optimization, test it in isolation (no other flags changed) before any combined run.
- Run targeted workloads 3x and report the average to reduce noise.
- Record commit SHAs, flags, iterations, and the exact command lines used.
Run these in both baseline and current:
swift run -c release SwiftSoupProfile --workload fixturesswift run -c release SwiftSoupProfile --workload fixturesOuterHtmlNoPrettyNoSourceRangesswift run -c release SwiftSoupProfile --workload fixturesTextswift run -c release SwiftSoupProfile --workload fixturesSelect
Pick the workload most likely to stress the change and run 3x:
- Example for selector cache changes:
swift run -c release SwiftSoupProfile --workload selectorCacheHeavy --iterations 1000000
git worktree add ../SwiftSoup-bench-base <baseline-commit>- Run the same commands in both trees, then compare deltas.
- Use
git rev-parse HEADto log the commit for each side.