surma / wasmphobia

https://wasmphobia.surma.technology/
Apache License 2.0
94 stars 5 forks source link

Add an option to ignore debug sections #1

Closed ramnivas closed 6 months ago

ramnivas commented 6 months ago

Add an option to ignore debug sections, which otherwise consume a considerable portion of the flamegraph and obscure the impact of actual code.

netlify[bot] commented 6 months ago

Deploy Preview for wasmphobia ready!

Name Link
Latest commit e1b9c1d5057c551fdab5a1436a331454a33cb87b
Latest deploy log https://app.netlify.com/sites/wasmphobia/deploys/663d15ec0f4a000008efb554
Deploy Preview https://deploy-preview-1--wasmphobia.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

ramnivas commented 6 months ago

I tried s.kind() == SectionKind::Debug, but debug sections come as SectionKind::Other and Other includes sections such as:

Section: Other Ok("__wasm_bindgen_unstable")
Section: Other Ok("name")
Section: Other Ok("producers")
Section: Other Ok("target_features")
surma commented 6 months ago

The problem with this is that it affects what is shown as the size for "all". But I see where you are coming from and why you'd want this. I'll have a ponder...

Just to check: You know the flame graph is interactive and you can click the code section to hide everything else, right?

surma commented 6 months ago

After thinking some more: I think you are right. The debug section would get stripped in a normal release build (or when you run wasm-opt), so offering to hide them to give you a representation “as if stripped” is a great idea. Thanks for whipping up a PR. Will review now.