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

Top offenders #1

Open
fengb opened this issue May 28, 2019 · 1 comment
Open

Top offenders #1

fengb opened this issue May 28, 2019 · 1 comment

Comments

@fengb
Copy link
Owner

fengb commented May 28, 2019

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
Copy link
Owner Author

fengb commented May 28, 2019

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.

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

1 participant