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

[x/programs] why we use the default Rust allocator vs wee_alloc #474

Closed
hexfusion opened this issue Sep 17, 2023 · 0 comments
Closed

[x/programs] why we use the default Rust allocator vs wee_alloc #474

hexfusion opened this issue Sep 17, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@hexfusion
Copy link
Contributor

hexfusion commented Sep 17, 2023

In many references to memory allocation in Wasm including the Rust book[1] claim that switching to wee_alloc is the best path forward. I did a deep dive here and found that to not be true.

Cons of wee_alloc

  • Latest release is 4 years+ old [4]
  • Unmaintained [2]
  • Memory leaks [3]

The general guidance is to use the default allocator. This issue is a historical reference to folks who will ask the question in the future.

[1] https://rustwasm.github.io/docs/book/reference/code-size.html?highlight=wee#avoid-allocation-or-switch-to-wee_alloc
[2] rustwasm/wee_alloc#107
[3] rustwasm/wee_alloc#106
[4] https://crates.io/crates/wee_alloc/versions

@hexfusion hexfusion added the documentation Improvements or additions to documentation label Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant