Skip to content

Stronger WASM compression#9875

Merged
ggwpez merged 3 commits intomasterfrom
oty-compression
Sep 30, 2025
Merged

Stronger WASM compression#9875
ggwpez merged 3 commits intomasterfrom
oty-compression

Conversation

@ggwpez
Copy link
Copy Markdown
Member

@ggwpez ggwpez commented Sep 29, 2025

Use strongest compression 22 instead of just 3. See docs.
Reduces our KAH compressed size by 25%.

Build time by compression level:

Compression Build Time Size Decomp Time
3 5:54 3192172 0.013039s
10 5:58 2716940 0.011962s
22 6:06 2387562 0.013745s

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@bkchr bkchr added the T17-primitives Changes to primitives that are not covered by any other label. label Sep 30, 2025
Copy link
Copy Markdown
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decompression speed should not be impacted by the level or only a little bit. So, this should be good. However, it would be nice to have some rough timings on how much the compilation time of AHM increases because of this extra compression.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez
Copy link
Copy Markdown
Member Author

ggwpez commented Sep 30, 2025

I checked the build time now after only changing the level and it does not seem to affect it much. 12 sec at most on a not-so-fast single threaded CPU.

In the future we can also update the zstd create and enable multi threading for the compression.

@ggwpez ggwpez enabled auto-merge September 30, 2025 10:50
@ggwpez ggwpez added the A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch label Sep 30, 2025
@ggwpez ggwpez added this pull request to the merge queue Sep 30, 2025
auto-merge was automatically disabled September 30, 2025 11:14

Pull Request is not mergeable

@ggwpez ggwpez removed the A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch label Sep 30, 2025
Merged via the queue into master with commit 7648b41 Sep 30, 2025
288 of 291 checks passed
@ggwpez ggwpez deleted the oty-compression branch September 30, 2025 12:13
ggwpez added a commit that referenced this pull request Sep 30, 2025
Backport #9875 into
`unstable2507` from ggqpez.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bee344 pushed a commit that referenced this pull request Oct 7, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
RomarQ pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Oct 8, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@RomarQ
Copy link
Copy Markdown
Contributor

RomarQ commented Oct 8, 2025

Really nice improvement 🚀

For moonbeam we have seen a nice difference:
image

alvicsam pushed a commit that referenced this pull request Oct 17, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
manuelmauro added a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Oct 31, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
RomarQ pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Nov 18, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
RomarQ pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Nov 18, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
RomarQ pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Nov 18, 2025
Use strongest compression 22 instead of just 3. See
[docs](https://docs.rs/zstd/0.13.3/zstd/stream/write/struct.Encoder.html#method.new).
Reduces our KAH compressed size by 25%.

Build time by compression level:

| Compression | Build Time | Size    | Decomp Time |
  |-------------|-----------|---------|-------------|
  | 3           | 5:54      | 3192172 | 0.013039s   |
  | 10          | 5:58      | 2716940 | 0.011962s   |
  | 22          | 6:06      | 2387562 | 0.013745s   |

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T17-primitives Changes to primitives that are not covered by any other label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants