Skip to content

chore: bump inventory 0.1 -> 0.3#9159

Merged
jerrykingxyz merged 3 commits intoweb-infra-dev:mainfrom
CPunisher:01-29-feat/bump-inventory
Feb 5, 2025
Merged

chore: bump inventory 0.1 -> 0.3#9159
jerrykingxyz merged 3 commits intoweb-infra-dev:mainfrom
CPunisher:01-29-feat/bump-inventory

Conversation

@CPunisher
Copy link
Contributor

@CPunisher CPunisher commented Feb 5, 2025

Summary

Rspack persistent cache depends on inventory v0.1. But it supports wasm in v0.3. The main barrier to upgrade is https://github.com/dtolnay/inventory/releases/tag/0.2.0. So this pr makes the following changes:

  1. Mark the functions used in inventory! with const.
  2. Calculate __DYN_ID with xxhash-rust, which supports calculating hash in const context(compile time). I think this also improves the performance.
  3. Transmute dyn vtable to a new VTablePtr struct with Send and Sync rather than usize, and use unsafe to guarantee the safety. The reason is that transmuting a vtable address to usize is not permitted by rustc since it is unknown in compile time.

This pr does not mean there is no other problem to use persistent cache in wasm. But at least it's something beneficial.

Checklist

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

@netlify
Copy link

netlify bot commented Feb 5, 2025

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit fb425ce
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67a3443c9ffcff000844d54c

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 5, 2025

CodSpeed Performance Report

Merging #9159 will not alter performance

Comparing CPunisher:01-29-feat/bump-inventory (fb425ce) with main (431a194)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 6 untouched benchmarks

@jerrykingxyz jerrykingxyz enabled auto-merge (squash) February 5, 2025 11:33
@jerrykingxyz jerrykingxyz merged commit 1b119cb into web-infra-dev:main Feb 5, 2025
30 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.

2 participants