Skip to content

Render lexical filename fields from borrowed path slices - #1044

Merged
helly25 merged 1 commit into
mainfrom
perf/lexical-field-views
Nov 2, 2026
Merged

helly25 merged 1 commit into
mainfrom
perf/lexical-field-views

Conversation

@helly25

@helly25 helly25 commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Render filename, stem and extension fields directly from borrowed input slices instead of constructing temporary path objects. Multi-field output improves on both hosts while preserving native directory spelling and the existing output.

AG;DR

  • O04 from the reconciled docs/performance-analysis.md / TODO.md inventory. Uses existing StringOrView; no new path wrapper, per-entry cache, thread pool, option or dependency.
  • Shared lexical helpers cover filename, stem, final extension, all suffixes and core. Path-component qualifiers and language/MIME filename lookup use the same slices.
  • Preserve parent_path for directory fields and qualifiers because repeated-separator normalization is observable. Consume borrowed component views while input/owned field values remain alive.
  • Keep empty/root/trailing-separator paths, dot/dot-dot, hidden files, compound suffixes, backslashes, virtual archive member names, embedded NULs and nonterminated input slices unchanged.
  • The new differential test has its own cc_test. The separate test-only benchmark measures precompiled templates over short/long in-memory paths; it is not linked into the CLI.

Evidence:

  • docs/benchmarks/lexical-field-views-20261102.md and three lossless archives retain source/binary identities, scripts, every raw sample, exact native output oracles and slower controls.
  • Reference main 2b21790 includes merged Share collection name and root storage with owned paths #1041/Prepare simple native globs and avoid pattern copies #1042. Runtime variants differ only in fields.cc; no unmerged fuzzy implementation is included.
  • LLVM 23 release + ThinLTO; three sessions, nine interleaved rounds, fastest seven, discarded native warmups. Linux tmpfs with child affinity 1/3/10; macOS warm APFS and requested workers 1/3/10 without affinity. 4,320 final fresh commands including warmups.
  • 100k-file six-field output: Linux 9-11% faster with one worker, 16-19% with three, 26-31% with ten. macOS 8.5% faster with one, about 5-6% with ten; three-worker cases remain near baseline or slightly slower. Six-field kernels improve 26-60% by path length/host; kernel gains are not filesystem-throughput claims.
  • Retain counterexamples: slowest paired native median +1.74% macOS / +2.08% Linux. Final output strings still allocate, and directory rendering keeps its native path cost.

Validation:

  • Complete release and extension suite: 305/305 on both hosts. Linux explicitly requires its working FUSE support.
  • Existing fields/fuzz suites and new native lexical differential/lifetime tests pass on both hosts; an added long-owned-parent case passes separately after the full suites.
  • Scoped local clang-tidy passes all three changed runtime/test/harness translation units. The benchmark-only unused token annotation leaves the measured executable code section byte-identical on both hosts; hashes are preserved.
  • Normal commit and push hooks pass, including local affected-file clang-tidy. Published-head CI results are recorded as they complete. No dependency on unmerged Reuse fuzzy score rows and cache normalization ceilings #1043; synchronize with main if it advances before merge.

Synchronization: head 2e981dd390 rebases onto merged #1043/main 9e4338a6ea. All four tracking-file conflicts preserve both changes. Field runtime/test sources remain unchanged. Normal enforcing push hooks pass, including the inherited fuzzy compilation scope. Earlier full-suite and benchmark evidence uses its recorded parent; all eight combined post-sync targets pass on both hosts, and all required replacement PR checks pass on this head, including coverage, sanitizers, clang-tidy, platform tests and benchmark aggregation.

@helly25
helly25 force-pushed the perf/lexical-field-views branch from f7fea20 to 2e981dd Compare November 2, 2026 01:36
@helly25
helly25 merged commit d546fcb into main Nov 2, 2026
32 checks passed
@helly25
helly25 deleted the perf/lexical-field-views branch November 2, 2026 02:30
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