Skip to content

Subsecond bloats wasm bundle size in release mode #5131

@SuperKenVery

Description

@SuperKenVery

Problem

In release mode, there are quite some subsecond related code in the wasm, resulting in a larger bundle size.

Steps To Reproduce

Steps to reproduce the behavior:

  • dx bundle --web --release --wasm-split
  • Access the website, find the wasm request, copy as curl, and download it
  • twiggy top logic.wasm

It takes about 6% space in my case:

twiggy top logic.wasm | rg -i subsecond | awk -F'┊' '{ gsub(/%/, "", $2); sum += $2 } END { print sum }'
6.43
twiggy top logic.wasm | rg -i subsecond
         43063 ┊     3.08% ┊ <T as subsecond::HotFunction<(),subsecond::Fn0Marker>>::call_it::he67825e518fcf2b4
         20679 ┊     1.48% ┊ <T as subsecond::HotFunction<(),subsecond::Fn0Marker>>::call_it::h17338d679aab9d0b
          9943 ┊     0.71% ┊ <T as subsecond::HotFunction<(),subsecond::Fn0Marker>>::call_it::h0c94f6c805ee28ad
          4226 ┊     0.30% ┊ <T as subsecond::HotFunction<(A,),subsecond::Fn1Marker>>::call_it::h3de7d1f38838dfbc

...

Expected behavior

See nothing.

Screenshots

Environment:

  • Dioxus version: 7.1
  • Rust version: 1.91.1
  • OS info: NixOS unstable
  • App platform: web, fullstack

Questionnaire

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions