Skip to content

[codex] Prehash resolver path dependencies#206

Draft
hardfist wants to merge 1 commit into
mainfrom
codex/prehash-path-dependencies
Draft

[codex] Prehash resolver path dependencies#206
hardfist wants to merge 1 commit into
mainfrom
codex/prehash-path-dependencies

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

@hardfist hardfist commented May 9, 2026

Summary

  • Add PathDependency and ResolvePreHashedContext so callers can consume resolver dependency paths with their precomputed path hash.
  • Reuse the same path hashing helper for the internal path cache and expose the identity hasher needed by the prehashed dependency set.
  • Short-circuit cached path equality by checking the precomputed hash before comparing full paths.

Why

Rspack build_module_graph path dependency handling currently hashes dependency paths in the resolver context and then hashes the same paths again when converting them into Rspack prehashed ArcPath sets. This API lets Rspack reuse the resolver-side hash instead of paying for another full Path hash during that conversion.

Validation

  • cargo check
  • cargo test tests::dependencies --lib
  • Full cargo test was also attempted; 124 tests passed and 6 existing PnP fixture tests failed with NotFound(...), which appears unrelated to this change.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 9, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing codex/prehash-path-dependencies (1bef3bc) with main (31610e6)

Open in CodSpeed

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