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

WASM #3

Closed
jpochyla opened this issue Jul 22, 2023 · 5 comments
Closed

WASM #3

jpochyla opened this issue Jul 22, 2023 · 5 comments

Comments

@jpochyla
Copy link

Hi, very cool project! Not an issue, just a question, sorry: do you have any plans for WASM support? How do you think talc would compare against the default dlmalloc? Thanks!

@SFBdragon
Copy link
Owner

No problem. The plan was to make functionality like this possible through the OOM handler feature.

The WASM memory API looks simple enough that the existing Talc API will be sufficient. (attempt to grow the memory on OOM and resize the arena accordingly via the oom_handler). Although in order to avoid adding lots of dependencies to Talc, I'll distribute the support via a separate script or crate. How does that sound?

I've just gotten a basic WASM project setup; I'll try have something done soon!

@pinkforest
Copy link

pinkforest commented Jul 25, 2023

Great,

I've been especially keen to see a new allocator for wasm space ever since wee_alloc was declared unmaintained

We mentioned that lol_alloc by @Craig-Macomber as a honorable mention but would be nice to see some more collaboration around in wasm space to have some alternatives - code sizes are the biggest concern for wasm as you want to shrink your .wasm typically.

@jpochyla
Copy link
Author

code sizes are the biggest concern for wasm as you want to shrink your .wasm typically

Just to note, for me, the biggest concern would be performance, not code sizes. lol_alloc, rlsf etc. are already quite small, in my opinion.

@SFBdragon
Copy link
Owner

I imagine talc-wasm is going to come in relatively heavy, at least at first. I'll see what I can do.

If anyone happens to know off the top of their head, is there a recommended way to measure talc's size contribution to a wasm binary?

@SFBdragon
Copy link
Owner

v2.2 has just gone up with WASM support. Take a look here for some details https://github.com/SFBdragon/talc/blob/master/README_WASM.md

I think it's quite satisfactory as-is for use in other projects, but let me know if there are any problems; esp. with OOM handling on extremely memory constrained platforms, like mobile devices.

I'll close this issue, so if anyone has more specific concerns (bugs, binary size improvements, etc. etc.) please open a specific issue for it. Thanks.

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

3 participants