Skip to documentation content
Branchcut
Evidence

Rust-level optimization pass

Measured allocation, matcher-state, ignore-context, and output-path improvements with retained losses.

Scope

This pass follows the first planner-level benchmark round. It targets Rust-level work inside the established architecture:

  • empty matcher programs now return empty state sets;
  • universal **/* plans bypass unused positive and negative state work;
  • count-only consumers can receive matches without materialized paths;
  • ordinary output streams borrowed parent/name path parts through one reusable byte buffer;
  • ignore checks reuse path-match scratch vectors and share inherited rule contexts;
  • parallel workers batch pathless counts and avoid per-file relative path joins when no consumer needs them.
  • metadata-free queries no longer materialize an absolute DirEntry path for a no-op metadata test.

These changes preserve matching, filtering, ignore, sorting, command, native-name, and limit semantics. The full matrix checks every generated path or count before timing and after each CLI sample.

Record

The retained final 52-workload record contains 26 workloads on each of the 10,000- and 100,000-file trees. It uses two warmups and seven measured samples per variant, alternating variant order. The focused no-metadata record uses three warmups and nine samples to isolate the final DirEntry::path() removal. The focused losing-case recheck uses three warmups and nine samples.

The earlier intermediate records are retained separately:

Filesystem cache state is uncontrolled. CLI measurements are fresh processes that include startup, planning, traversal, output, and pipe draining. Warm-engine measurements reuse one compiled plan.

Results

Across all 26 comparable workloads, the final geometric-mean fresh-process ratio was 1.014x at 10,000 files and 1.166x at 100,000 files. The warm-engine geometric means were 1.135x and 1.305x. These are before/after comparisons against one preserved Windows build, not competitor claims.

Selected 100,000-file medians:

WorkloadBeforeAfterRatio
Broad count146.69 ms102.48 ms1.43x
Broad streamed output182.12 ms140.66 ms1.30x
Exclusion-heavy traversal109.92 ms94.66 ms1.16x
Ignore-heavy traversal175.02 ms129.79 ms1.35x
Four-worker count93.94 ms71.21 ms1.32x
Four-worker output73.37 ms53.88 ms1.36x

The final matrix also measured JSON output at 1.32x, NUL output at 1.45x, and sorted-ten selection at 1.38x. Unlimited sorting was 0.98x, modification-time filtering 0.97x, size filtering 1.03x, and first-ten selection at 0.96x. The small-tree matrix had five losses of at least 2%, led by unrelated-pattern cases; these are not hidden or averaged into the highlighted results.

Limits

Metadata predicates remain dominated by per-candidate filesystem metadata and improved little. Sorted full-result output still spends most of its time retaining and ordering every path; this pass does not change that algorithm. The synthetic tree has shallow ignore nesting, so shared ignore contexts show architectural and allocation benefit without a distinct timing claim on this fixture.

Public-repository, million-file, Linux, macOS, cold-disk, and profiler-attributed allocation measurements remain open. No result establishes universal performance superiority.

On this page