Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor crate features for more control over hash-maps usage #1265

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Oct 29, 2024

This allows to drop some wasmi_collections dependencies when unused for improved compile times.

Usage

Wasmi users who previously used no-hash-maps should simply use prefer-btree-collections now instead to make sure to always use btree-based collections in their compiled artifacts.

Summary

  • Removes no-hash-maps crate feature. Also remove it from default feature set.
  • Adds hash-collections crate feature.
  • Adds prefer-btree-collections crate feature.

Feature/collections usage matrix:

hash-collections prefer-btree-collections usage
false false btree (default)
true false hash
false true btree
true true btree

Similar to: https://github.com/bytecodealliance/wasm-tools/pull/1866/files
Will be even more useful once #1141 has been merged.

Benchmarks

Before After
Compiled Crates 22 15
Build Time (dev) 5.8s 5.5s
Build Time (release) 7.9s 7.7s

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@c724b91). Learn more about missing BASE report.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1265   +/-   ##
=======================================
  Coverage        ?   81.18%           
=======================================
  Files           ?      310           
  Lines           ?    25279           
  Branches        ?        0           
=======================================
  Hits            ?    20523           
  Misses          ?     4756           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Docs are superflous since it is obvious where to look-up the docs.
@Robbepop Robbepop merged commit ef5cdf4 into main Oct 29, 2024
19 checks passed
@Robbepop Robbepop deleted the rf-refactor-collections-crate-features branch October 29, 2024 14:31
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