Skip to content

perf: reuse source-entry metadata and compiled exclusions (#100) - #107

Merged
TristanKruse merged 5 commits into
mainfrom
perf/source-walk-100
Nov 24, 2026
Merged

TristanKruse merged 5 commits into
mainfrom
perf/source-walk-100

Conversation

@TristanKruse

@TristanKruse TristanKruse commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #100. First implementation from the research-issue triage: #100 → #101 → #102 → #106 → #104 → #103 → #105.

  • Replace duplicated Find/callback traversal work with a private pruned iterative walker: one child lstat, child-component identifiers under the canonical root, compiled glob decisions and exact-basename lookup, and one final source-list sort.
  • Preserve root canonicalization, symlink/nonregular-entry skipping, defaults/repository/caller exclusions, normalized identifiers and unchanged graph/evidence/cache/baseline contexts.
  • Explicit correctness hardening: unreadable/disappearing included directory listings now raise the existing TechnicalError, rather than inheriting Find's silent directory-listing skip. Excluded trees are not opened. This behavior is documented and tested.
  • Extend the existing extraction benchmark with cold allocation counts, graph/evidence digests and malformed excluded-tree workloads. Add manually dispatched paired Linux/Windows jobs to the existing performance-study workflow, with read-only permissions, pinned actions and raw artifacts.
  • Prepare unreleased 1.1.1 metadata only. Published 1.1.0 is unchanged; this PR does not publish anything.

ArchUnit family alignment

No new public fluent API or mandatory dependency. Ruby-specific filesystem work remains in extraction; common projections/assertions and existing Checkable behavior stay unchanged.

Evidence and regression coverage

  • Differential controls compare sources against the previous Find implementation across root/basename/path/hidden/Unicode/glob shapes.
  • Deterministic operation-count checks prove duplicate metadata/path work is gone; default literal patterns need no per-entry glob calls.
  • Excluded subtrees, nonregular files, portable mocked links, native root links, disappearing/unreadable entries, deep synthetic traversal, Windows drive and UNC component construction, and encoding have explicit controls.
  • Three local Windows fresh-process pairs per workload preserve identical ordered graph/evidence digests, actual source counts and cache reuse. Full raw local samples are retained in benchmark/study/discovery-windows.json.
  • Sparse 10,000 (+1 shared) median cold analysis: 13.830s → 7.839s; enumeration: 7.253s → 1.948s; allocated objects: 10,414,873 → 5,252,199. Machine/load-dependent observations, not timing gates or a universal speed claim; allocations are not retained memory.

Verification

  • Full local coverage/rake: 921 examples, zero failures; eleven expected native-symlink skips on this Windows host. Runtime-library coverage: 98.70% line / 92.20% branch.
  • RuboCop: 346 files, no offenses.
  • Documentation: 204 pages validated; strict gem build succeeds.
  • Default cache/baseline/report contracts unchanged; public APIs remain lazy and immutable.
  • All twelve fresh installed-gem API/CLI regression scripts pass with unreleased 1.1.1.
  • GitHub compatibility/package/security and all four production canaries pass (final evidence-only commit is checked again before marking ready).
  • Paired Linux/Windows study passes on measured code 78653585f47c72a487687e6df210149c8646e643; full timed samples and post-GC retained-memory data are committed in benchmark/study/discovery-ci.json.
  • API/benchmark docs, changelog and next-patch development metadata updated.
  • No credentials, private source or customer data included.

Hosted 10k cold medians: Linux 1.750s → 1.078s, Windows 5.922s → 3.688s, with substantially lower allocations and essentially unchanged post-GC heap growth. Memory/latency tradeoff: Linux peak RSS is lower at 10k but about 10% higher at 5k; one small excluded-tree warm lookup rises from 0.117ms to 0.902ms (still below 1ms). These GC/load-sensitive observations are retained explicitly, not described as uniform memory or warm-latency improvements. See the benchmark guide and raw samples.

The initial research job exposed a stale local path-gem version in its isolated lock; both local-version entries are synchronized without changing any pinned research dependency, and a version-alignment regression test was added. Frozen lock enforcement remains enabled.

The synthesized UNC test proves path construction without opening a network share; it is not a claim that an actual UNC share was available on this host. No release is performed; #100 closes only after merge.

@TristanKruse
TristanKruse marked this pull request as ready for review November 24, 2026 12:25
@TristanKruse
TristanKruse merged commit e2d347e into main Nov 24, 2026
17 checks passed
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.

Performance: eliminate redundant source-walk metadata and path work

1 participant