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

mimalloc adds >60kb into output artifacts #22094

Open
jozefchutka opened this issue Jun 13, 2024 · 3 comments
Open

mimalloc adds >60kb into output artifacts #22094

jozefchutka opened this issue Jun 13, 2024 · 3 comments

Comments

@jozefchutka
Copy link

Using em++:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.61 (67fa4c16496b157a7fc3377afd69ee0445e8a6e3)
clang version 19.0.0git (https:/github.com/llvm/llvm-project 7cfffe74eeb68fbb3fb9706ac7071f8caeeb6520)
Target: wasm32-unknown-emscripten
Thread model: posix

Adding -s MALLOC=mimalloc adds additional 52kb into .wasm and 9kb into .js outputs. Is that expected?

Example:

em++ main.cpp -s MALLOC=mimalloc -O3 -o wasm/mfcc.js
# produces: 60kb .wasm + 13kb .js
em++ main.cpp -O3 -o wasm/mfcc.js
# produces: 8kb .wasm  + 4kb .js

Just checking, is that expected? Is the mimalloc so heavy?

@kripken
Copy link
Member

kripken commented Jun 13, 2024

I believe that is expected, yes. mimalloc is more complex than dlmalloc, and includes additional optimizations, which add a significant amount of code.

It might be worth looking into that in detail to see if we can disable parts of mimalloc that we don't use, I know it has a bunch of flags.

@jozefchutka
Copy link
Author

@kripken please let me know if you use this ticket for looking into that in detail to see if we can disable parts of mimalloc else feel free to close it.

@kripken
Copy link
Member

kripken commented Jun 25, 2024

Let's leave this open for that purpose, yeah. It is worth looking into, if someone has time.

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

No branches or pull requests

2 participants