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

Implement better size profiler #724

Closed
binji opened this issue Jan 18, 2018 · 4 comments
Closed

Implement better size profiler #724

binji opened this issue Jan 18, 2018 · 4 comments

Comments

@binji
Copy link
Member

binji commented Jan 18, 2018

See Oxidizing Source Maps with Rust and WebAssembly.

We found size profiling WebAssembly was more difficult than necessary. To get useful information presented meaningfully, we were forced to write our own home-grown script to post-process wasm-objdump. The script constructs the call graph, and lets us query who the callers of some function were, helping us understand why the function was emitted in the .wasm file, even if we didn’t expect it to be. It is pretty hacky, and doesn’t expose information about inlined functions. A proper WebAssembly size profiler would have helped, and would be a benefit for anyone following in our tracks.

It shouldn't be too difficult to add this functionality to wabt.

@fitzgen
Copy link

fitzgen commented Jan 19, 2018

FWIW, I wrote down my wish-list for such a tool here: rustwasm/team#20 (comment)

TLDR: size profiling is very similar to heap profiling, just with different graphs: call graph vs heap graph and exported functions vs GC roots.

@binji
Copy link
Member Author

binji commented Jan 19, 2018

Thanks, that's useful information! It seems like a lot of your requirements are rust-specific (or at least require standardized debug info). But I think we can provide some of the functionality in a generic way in wabt.

@fitzgen
Copy link

fitzgen commented Jan 19, 2018

I think the only thing that requires new debuginfo would be inlined code analysis. The monomorphizations can be determined by symbol name (either Rust or C++ specific symbol parsing) which should be in the existing "name" section (if it isn't inlined).

All the call graph related analyses should be doable regardless of language and debug info.

@fitzgen
Copy link

fitzgen commented Feb 5, 2019

https://github.com/rustwasm/twiggy implements everything I was imagining here. I think we can close this issue :)

@binji binji closed this as completed Feb 5, 2019
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