Repository navigation
Reduce unused evaluation and shard setup in ordinary walks - #1151
Conversation
Benchmark previewAdvisory: changes over 15% are warnings, not merge failures. Positive reference-adjusted change means slower; negative means faster. linuxPerformance overviewWARNING: 1 comparison(s) exceed the 15% slowdown threshold. Advisory only. Merged baseline: efffe25; run 42518987368, attempt 1; mean of fastest 7/9 runs. Compatible comparisons: 360/360; unavailable: 0.
Largest regressions:
Typical change is an equal-weight geometric mean of reference-adjusted XFF/main factors. Negative is faster; positive is slower. These correlated cases are not a significance test. Tested merge macosPerformance overviewNo compatible merged baseline comparisons are available; regression status is unknown. Advisory only. Merged baseline: unavailable. Compatible comparisons: 0/360; unavailable: 360.
Typical change is an equal-weight geometric mean of reference-adjusted XFF/main factors. Negative is faster; positive is slower. These correlated cases are not a significance test. Tested merge |
Reduce ordinary directory-walk overhead by preparing deferred evaluation and shard matching only when used, and by checking each predicate descriptor once.
The change follows measured startup/per-entry work. It includes production-build comparisons on Linux and macOS, correctness checks, controls and the results that did not improve.
AG;DR
Implementation
shard::Matcher::Makewhen neither shard grouping nor-shard-statusis active. Profiles showed built-in RE2 shard patterns being compiled for plain-type f -print0. Optional observers preserve ordinary collections and-top; explicit shard consumers retain eager validation and existing behavior.Validation and evidence
1ea02a41d7dcf25c043e1079c98a9e60d6d73290; baseline merged Fix historical backfill runtime compatibility and deadlines #1149,efffe2529f26c1c7ca61763fa5fbb17efd573f6f. Subsequent commits add qualification documentation and release-site mappings, and merge main through Fix historical Linux backfills on a compatible modern runtime #1150, without changing these C++ sources.//xff/cli:xff_full --config=clang_release --config=xff_full. Configured executable copies, source/configuration hashes and ThinLTO CppLink actions are retained. No builds ran during accepted timing collection on the same host.//xff/cli:xff --config=clang_releaseon both hosts (24 listing cells each, 27/21 rounds/keep). Linux large-listing ratio 0.985538/control 1.010545 agrees with full-feature gains. Mac minimal large ratio 0.968880/control 1.056338 is inconclusive, with control p95 factor 1.4369; all those controls and samples remain visible. No general minimal-Mac speedup claim.docs/benchmarks/lazy-evaluation-shard-setup-20261108.{md,json}; raw samples/build evidence/viewers are retained locally and on drogon.Remaining gap and limits
A separate output-checked minimal-CLI syscall diagnostic found exactly the same getdents64/write counts as GNU find for both 100k listing shapes. Normal minimal-CLI samples still show roughly 4-6 ms extra userspace CPU per 100k files. That is the next profiling target; the work does not establish that XFF always beats find.
Intervals describe paired within-cell variability, without correction for multiple comparisons or independent-machine confidence. Keep all cases and controls visible. This PR does not relabel extended measurements as core CI history or pretend continuous extended-history publication is already integrated. Historical Linux runtime recovery merged separately as PR #1150.
CI follow-up
The first CI run passed the renderer tests and all production correctness/benchmark jobs, but the configured release-site build rejected the new qualification report because its page mapping was missing. Add both the Markdown page and its JSON evidence to
release-site.json. All 32 release-site regression tests and the complete configured documentation build pass locally; the generated report link resolves and its JSON bytes match the retained source. Synced the branch with main (#1150). The original run finished before pushing this follow-up.Integration with adaptive ordered output (#1152)
Synchronized with main
a600f8e307feef9a7238fa253e9ce1b682a38758in merge commitdf3558fd122f9b811ee781baaf09ae8340e71c1b. The only textual conflict wasrelease-site.json; both report pages and evidence mappings are retained. The runtime changes merged automatically and were reviewed against main: descriptor binding, lazy deferred-entry state and conditional shard matching remain intact alongside #1152's output-credit/CPU-budget ownership.Fresh combined-tree verification is complete on both hosts:
ld.lldoverride; CI retains its normal runner linker.a600f8e. The original dirty checkout is untouched.-flto=thin. Actual lean release images are9e3f3cc84e87fdf135378063a2f43f0e885932d894e1c68525be7e865b3e4cb5(macOS, 4,223,056 bytes) and633d81bfbc206a6c2ac188d6081d787c69aff844a1a9c8e6efa3769312d39953(Linux, 12,826,408 bytes). These add 720 and 2,464 bytes respectively against the measured main-equivalent images.The original dated populations above remain historical qualification. An additional lean-CLI confirmation now compares the actual synchronized images against #1152's measured main-equivalent runtime, with an independently copied identical-main control:
0.971864, identical-control ratio1.001113; macOS0.993965, control0.999197. These are this fixture/host population's results, not universal speedups or reference-normalized CI results. Linux uses tmpfs and OS-reported distinct-core affinity; macOS uses the retained temporary fixtures without affinity, not the earlier HFS+ RAM-image population.Retained integration archives on drogon, independently hash-checked against local copies:
/home/marcus/Documents/xff-pr1151-integration-linux-qualified-df3558f-20261109.tar.gz, SHA256481f429427876dcac47501a4bbf3069a3291e677e4f4970e2906f88d315f8eb9(9,175,753 bytes)./home/marcus/Documents/xff-pr1151-integration-macos-qualified-df3558f-20261109.tar.gz, SHA256799d31b055dc81765c684128d27d6daa15d934342758fb1827ceecafb2035990(3,534,663 bytes).These retain the raw populations, slower observations, exact image bytes/hashes, commands, source identities, verification logs and drivers; they are project-host evidence, not public GitHub artifacts. No candidate source changed during qualification. Integration CI
42557985691completed with one fixture-marker false failure; the following test-only correction is head205428638215e4d9a49ea19b15bb1fb80c0b04cb, with replacement run42561479105. No previous-head check is substituted for that run. #1154 remains a dependent follow-up and is not being rewritten concurrently.Integration CI at df3558f and advisory review
Run
42557985691tests merge93f8792c2a5b6b15f50946668e1fb712b99f2b3cfor headdf3558f. Coverage passes: changed lines 29/29 (100%), branches 23/26 (88.46%). Pre-commit, Trunk, release-site, GCC, minimal, Markdown, clang-tidy, macOS tests, Ubuntu 24.04, ASan, TSan, MSan, both expression-measurement jobs and the tool-comparison aggregator passed. Ubuntu latest failed only the fixture-marker assertion described below, with the final aggregate reflecting that failure.The current comparison artifact has two Linux reference-adjusted fuzzy warnings against main
52950f937a: broad 500 files/one worker +16.64%, deep 2,000/one worker +17.97%. Raw XFF times improve 4.19% / 4.36%, whilefind+fzfimproves 17.86% / 18.92%. The typical normalized change over all 360 cells is approximately flat. macOS still has no compatible retained merged CI baseline, so its CI regression status remains unknown. Do not substitute the previous-head PR comment for these artifact results.A scoped native paired confirmation uses those exact canonical fixture identities and scenario arguments, plus listing controls. It retains current-main, an independent same-main image copy, the candidate and the older CI-baseline image: three sessions, nine rounds/seven retained, 480 output-oracle-checked invocations per host. Fuzzy cases show median within-session elapsed changes versus current main of -6.14% / -3.97% on Linux (controls +0.86% / -0.45%) and -2.24% / -0.58% on macOS (controls -0.60% / +0.65%). The local check also does not reproduce a slowdown versus the older CI-baseline image. It uses regular-file capture rather than CI pipe capture and does not invalidate the CI observations or establish their cause. Both CI artifacts, raw confirmation populations, driver and independently checked arithmetic are retained in the supplemental integration capsule.
Deterministic correction for the Ubuntu archive fixture failure
The completed integration run passed 330/331 Ubuntu-latest test targets.
archive_dive_testfailed because its random temporary directory wastmp.xg3GOTvZn0: the expected archive-member refusal diagnostic legitimately contained that path, but the test treated anyGOTsubstring as proof its forbidden child ran. The archive command itself correctly refused execution.Commit
2054286382changes only this shell test. Rename its fixture archive toGOT.tarso the collision is deterministic; assert absence of the complete child output (GOTplus the exact member path), while keeping exit-2/refusal checks and successful container-file execution. The seeded archive reproduces the old assertion failure on macOS. The corrected full archive-diving target then executes and passes all 44 cases on both macOS and drogon. Normal commit/push hooks, shfmt and shellcheck pass. No runtime, C++ source, toolchain or benchmark input changed, so the frozen runtime measurements above retain their stated provenance.The actual current head is
205428638215e4d9a49ea19b15bb1fb80c0b04cb. Its own replacement Test run42561479105is fully successful, including the formerly failing Ubuntu-latest target, all platforms/sanitizers, clang-tidy, expression measurements, benchmark comparison and the finaldonegate. The earlier run was already terminal before the fix was pushed. No live CI job was canceled.Final-head benchmark result
The current run uses merged #1152 (
a600f8e, main benchmark run42553697889) for Linux: 360/360 matched comparisons, typical reference-adjusted change -1.4%, no 15% slowdown alarms. Its retained Linux executable SHA exactly matches the locally qualified production image. The previous-run warnings above remain historical observations, not current-head alarms.macOS still reports no compatible CI baseline. The main/PR contracts differ only in native accounting-helper SHA. Direct artifact inspection shows identical loaded sections/addresses and dynamic-binding/function payloads; differing debug-map sandbox paths in the symbol table change the file hash, UUID and signature metadata. The strict raw-file hash therefore prevents this comparison. Preserve
unknownuntil a separately tested identity correction; do not simply drop the fingerprint or relabel historical reports. Native paired macOS qualification above remains separate evidence.