$ ./bloaty main.wasm -n 0 -d sections,symbols
VM SIZE FILE SIZE
-------------- --------------
NAN% 0 .debug_info 13.6Ki 30.0%
NAN% 0 .debug_str 9.38Ki 20.8%
NAN% 0 .debug_line 7.60Ki 16.8%
NAN% 0 .debug_abbrev 4.14Ki 9.2%
NAN% 0 Code 3.86Ki 8.6%
NAN% 0 puts 1.62Ki 41.9%
NAN% 0 writev_c 365 9.2%
NAN% 0 fwrite 359 9.1%
NAN% 0 __stdio_close 289 7.3%
NAN% 0 __syscall_ret 198 5.0%
NAN% 0 dummy 175 4.4%
NAN% 0 __lockfile 165 4.2%
NAN% 0 __syscall3 121 3.1%
NAN% 0 __overflow 107 2.7%
NAN% 0 fputs 107 2.7%
NAN% 0 __wasm_call_ctors 96 2.4%
NAN% 0 __syscall4 93 2.4%
NAN% 0 main 92 2.3%
NAN% 0 __errno_location 35 0.9%
NAN% 0 __syscall5 34 0.9%
NAN% 0 __towrite 28 0.7%
NAN% 0 __syscall0 18 0.5%
NAN% 0 __syscall1 5 0.1%
NAN% 0 __unlockfile 5 0.1%
NAN% 0 [section Code] 4 0.1%
NAN% 0 putc_js 3 0.1%
NAN% 0 .debug_pubtypes 3.10Ki 6.9%
NAN% 0 Data 1.19Ki 2.6%
NAN% 0 .debug_pubnames 1.05Ki 2.3%
NAN% 0 .debug_ranges 353 0.8%
NAN% 0 name 310 0.7%
NAN% 0 __wasm_call_ctors 19 6.1%
NAN% 0 __errno_location 18 5.8%
NAN% 0 __stdout_write 16 5.2%
NAN% 0 __stdio_close 15 4.8%
NAN% 0 __stdio_write 15 4.8%
NAN% 0 __syscall_ret 15 4.8%
NAN% 0 __stdio_seek 14 4.5%
NAN% 0 __unlockfile 14 4.5%
NAN% 0 [section name] 12 3.9%
NAN% 0 __lockfile 12 3.9%
NAN% 0 __overflow 12 3.9%
NAN% 0 __syscall0 12 3.9%
NAN% 0 __syscall1 12 3.9%
NAN% 0 __syscall3 12 3.9%
NAN% 0 __syscall4 12 3.9%
NAN% 0 __syscall5 12 3.9%
NAN% 0 __towrite 11 3.5%
NAN% 0 writev_c 10 3.2%
NAN% 0 putc_js 9 2.9%
NAN% 0 __wait 8 2.6%
NAN% 0 fwrite 8 2.6%
NAN% 0 memcpy 8 2.6%
NAN% 0 strlen 8 2.6%
NAN% 0 dummy 7 2.3%
NAN% 0 fputs 7 2.3%
NAN% 0 main 6 1.9%
NAN% 0 puts 6 1.9%
NAN% 0 .debug_loc 276 0.6%
NAN% 0 Import 102 0.2%
NAN% 0 Type 73 0.2%
NAN% 0 Export 57 0.1%
NAN% 0 .debug_macinfo 38 0.1%
NAN% 0 Function 23 0.0%
NAN% 0 Global 23 0.0%
NAN% 0 Element 12 0.0%
NAN% 0 [WASM Header] 8 0.0%
NAN% 0 Table 7 0.0%
NAN% 0 Memory 5 0.0%
100.0% 0 TOTAL 45.1Ki 100.0%
--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oh wow, nice :) This could be very useful, especially the diffing and other features bloaty has.
As you said, VM size might not make sense for wasm, yeah. How much memory is used when loaded depends on the VM, which might interpret it, or JIT it, in various ways. There is no expected correspondence between a wasm file and how much memory the wasm VM uses at runtime for it.
Testing this out, I see some odd things, maybe a bug? [...] Perhaps an indexing mixup?
Also, I haven't looked into the contents of the .debug_* sections. I've heard that this is DWARF; maybe I could mine this info for more size-profiling info.