zee_alloc icon indicating copy to clipboard operation
zee_alloc copied to clipboard

Top offenders

Open fengb opened this issue 6 years ago • 1 comments

Generated from twiggy

 Shallow Bytes │ Shallow % │ Item
───────────────┼───────────┼─────────────────────────────────────────────────────
           808 ┊    41.41% ┊ main.ZeeAlloc((struct main.Config constant)).realloc
           252 ┊    12.92% ┊ "function names" subsection
           173 ┊     8.87% ┊ realloc
           102 ┊     5.23% ┊ malloc
            98 ┊     5.02% ┊ data[1]
            79 ┊     4.05% ┊ main.WasmPageAllocator.realloc
            60 ┊     3.08% ┊ main.ZeeAlloc((struct main.Config constant)).shrink
            57 ┊     2.92% ┊ main.ZeeAlloc((struct main.Config constant)).free
            47 ┊     2.41% ┊ memset
            40 ┊     2.05% ┊ calloc
            29 ┊     1.49% ┊ free

fengb avatar May 28 '19 02:05 fengb

Baselines using --release-small --strip but not wasm-strip or wasm-opt:

  • 610 — wasm_page_allocator attached to malloc / free
  • 520 — wasm_page_allocator directly calling reallocFn
  • 298 — allocPages without allocator interface

Edit: I tried using allocPages directly from ZeeAlloc and only saved ~90 bytes. I don't think these are useful comparisons, as any zig program probably should use the standard allocator interface.

fengb avatar May 28 '19 14:05 fengb