Skip to content

perf(hash): reduce hash digest allocations#14097

Closed
intellild wants to merge 1 commit into
mainfrom
codex/hash-smolstr-zero-copy
Closed

perf(hash): reduce hash digest allocations#14097
intellild wants to merge 1 commit into
mainfrom
codex/hash-smolstr-zero-copy

Conversation

@intellild
Copy link
Copy Markdown
Contributor

Summary

  • replace hash salt storage with SmolStr
  • avoid intermediate hash digest buffer copies before encoding
  • encode base-N digests into SmolStr without String, to_vec, copy_from_slice, or reverse
  • use inline SmolStr for short base-N output and write longer output directly into Arc<str> storage

Testing

  • cargo fmt -p rspack_hash --check
  • cargo test -p rspack_hash
  • cargo check -p rspack_binding_api

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@intellild intellild marked this pull request as draft May 20, 2026 07:27
@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 344794c to feat(css): add supports import, animation, customIdents, and dashedIdents for CSS (#14076) by AsyncIter

❌ Size increased by 4.00KB from 61.91MB to 61.91MB (⬆️0.01%)

@github-actions
Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (a65509ae59) does not have baseline artifacts. Using commit 239535b63c for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 6 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
popular-libs 1.7 MB 0
react-10k 5.7 MB 0
react-1k 826.3 KB 0
react-5k 2.7 MB 0
rome 1.6 MB 0
ui-components 4.8 MB 0

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented May 20, 2026

Merging this PR will not alter performance

✅ 36 untouched benchmarks
⏩ 25 skipped benchmarks1


Comparing codex/hash-smolstr-zero-copy (344794c) with main (239535b)

Open in CodSpeed

Footnotes

  1. 25 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@intellild intellild closed this May 22, 2026
@intellild intellild deleted the codex/hash-smolstr-zero-copy branch May 22, 2026 08:59
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