Skip to content

Huge source map since 4.0.22 #26100

@stevenwdv

Description

@stevenwdv

Since v4.0.22 the source map (-gsource-map) for our application has become huge.
In v4.0.21, ourApp.wasm.map was 8.3 MiB, but in v4.0.22 and v4.0.23 it's 1.9 GiB, which hangs (Firefox) / crashes (Chrome) the browser when opening the console. (For chrome, we can use DWARF, but for Firefox this is not an option.) I presume that the cause for this is #25870.

Is there a possibility that this could be reduced, or maybe to add a setting to exclude certain large sections or truncate long names? Or maybe use mangled names (see below)?

Some observations:

  • When compressed with a simple gzip ourApp.wasm.map, ourApp.wasm.map.gz is just 24 MiB, meaning there's a lot of duplicate text in there.
  • I thinks the cause is probably the same as for [WebAssembly] Huge symbol name section in debug build llvm/llvm-project#126919, meaning demangling C++ templated identifiers lead to a size explosion. Indeed, a quick cat ourApp.wasm.map spams my screen with such identifiers. We're already using -Wl,--no-demangle to mitigate the LLVM issue, but this doesn't seem to affect the source map.
  • When counting word frequency, I see that our namespace occurs 33M times and std occurs 29M times. The likely culprit, rxcpp, occurs 10M times (we want to ditch it but don't have time).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions