Arc-blroth / memory-stats

A cross-platform-ish memory profiler for Rust!
Apache License 2.0
19 stars 3 forks source link

wasm web-sys support #1

Open emilk opened 1 year ago

emilk commented 1 year ago

Hi, and thanks for this useful library!

What would make it even more useful to me is if worked on the web (wasm32-unknown-unknown), probably using window.performance.memory.usedJSHeapSize.

emilk commented 1 year ago

Blocked on https://github.com/rustwasm/wasm-bindgen/issues/3159

Arc-blroth commented 1 year ago

WASM support also sounds useful to me, so feel free to shoot a PR when that gets unblocked!

(sorry for the late response I've been busy with college)

emilk commented 8 months ago

This is now unblocked:

https://docs.rs/web-sys/latest/web_sys/struct.Performance.html#method.measure_user_agent_specific_memory

Note that it is chrome-only, and behind the web_sys_unstable_apis feature flag.

Anways, I don't have time to work on this right now, but I'm leaving this here for someone else, or for future me :)

Arc-blroth commented 4 months ago

I'm slightly hesitant to include this API in memory-stats right now, since it is both unstable and vendor-specific; that being said at least #8 should unblock building on WASM right now