rust-bitcoin / rust-bitcoin/rust-miniscript

WASM output size increased dramatically after using `finalize_mall`

Open
#552 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
426
Forks
200
Avg merge
7d 17h
Merged PRs (30d)
8

Description

So after we introduce finalize_mall the size of the output jump from 105988 bytes to 1920836. Here is the repo to reproduce. You could comment out the line 20 in lib.rs and rebuild to see the size difference.

Here is the twiggy output:

 Shallow Bytes │ Shallow % │ Item
───────────────┼───────────┼─────────────────────
       1114182 ┊    50.45% ┊ data[27]
        130051 ┊     5.89% ┊ code[58]
         36760 ┊     1.66% ┊ code[141]
         34324 ┊     1.55% ┊ code[124]
         33238 ┊     1.51% ┊ code[133]
         33160 ┊     1.50% ┊ code[134]
         26996 ┊     1.22% ┊ code[0]
         22455 ┊     1.02% ┊ code[4]
         15285 ┊     0.69% ┊ code[702]
         13561 ┊     0.61% ┊ code[24]
         12668 ┊     0.57% ┊ code[3]
         10724 ┊     0.49% ┊ code[31]
          8538 ┊     0.39% ┊ data[3]
          8232 ┊     0.37% ┊ code[1]
          8226 ┊     0.37% ┊ code[9]
          8226 ┊     0.37% ┊ code[10]
          8226 ┊     0.37% ┊ code[11]
          8158 ┊     0.37% ┊ code[12]
          8081 ┊     0.37% ┊ code[5]
          8074 ┊     0.37% ┊ code[2]
        659305 ┊    29.85% ┊ ... and 2521 more.
       2208470 ┊   100.00% ┊ Σ [2541 Total Rows]
       

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the size change using the linked miniscript-size-reproduce repository, then inspect lib.rs around line 20 and compare builds with that line enabled and commented out. Use the provided twiggy output to investigate the source of the added data and code; done means identifying and resolving the dramatic WASM output-size regression while preserving finalize_mall behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.