Skip to content

perf(wasm): publish compressed binaries outside JS glue - #253

Draft
BridgeAR wants to merge 2 commits into
mainfrom
BridgeAR/2026-09-03-wasm-external-assets
Draft

BridgeAR wants to merge 2 commits into
mainfrom
BridgeAR/2026-09-03-wasm-external-assets

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Sep 3, 2026

Copy link
Copy Markdown
Member

Publishes each Brotli-compressed WASM binary beside its generated loader instead of base64-encoding it in JavaScript. Updates package, bundler, size, and deployment contracts for the adjacent asset.

The two release artifacts shrink from 588,918 to 454,783 packaged bytes (22.8%).

Tested with the complete package suite and targeted ESLint.

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Overall package size

Self size: 36.15 MB
Deduped: 36.15 MB
No deduping: 36.15 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------|

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@BridgeAR
BridgeAR marked this pull request as ready for review September 3, 2026 20:34
@BridgeAR
BridgeAR requested review from a team as code owners September 3, 2026 20:34
@BridgeAR
BridgeAR marked this pull request as draft September 4, 2026 21:45
Base64-encoding Brotli data inside generated JavaScript expands the published fallback and forces parsers to process binary payloads as source. Keep the generated loader small and publish each compressed WASM binary beside it instead.

The two release artifacts shrink from 569,388 to 440,438 packaged bytes (22.6%). Bundler and installed-package tests pin the required adjacent-asset contract.
The marker gives build tools a stable boundary for replacing the synchronous sidecar read without changing direct package loading.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-09-03-wasm-external-assets branch from be08916 to e80a4dc Compare September 22, 2026 16:52
@github-actions

Copy link
Copy Markdown

WASM size comparison

Compared e214315 (base) with 3c2b373 (PR merge).

Artifact Before After Change
libdatadog 244,451 (238.7 KiB) 188,584 (184.2 KiB) -55,867 (-22.85%)
remote config 336,768 (328.9 KiB) 260,008 (253.9 KiB) -76,760 (-22.79%)

Negative changes reduce size.
Crate sizes come from symbol-preserving builds with debug names excluded and generic functions assigned to their symbol owner.

libdatadog: 3 changed, 43 unchanged

Packaged artifact layers

Packaged artifact layer Before After Change
JavaScript glue/loader 20,527 (20.0 KiB) 20,641 (20.2 KiB) +114 (+0.56%)
Final packaged artifacts 244,451 (238.7 KiB) 188,584 (184.2 KiB) -55,867 (-22.85%)
Base64 encoding overhead 55,981 (54.7 KiB) 0 (0.0 KiB) -55,981 (removed)
Raw WASM (before Brotli) 492,791 (481.2 KiB) 492,791 (481.2 KiB) 0 (0.00%)
Brotli-compressed WASM 167,943 (164.0 KiB) 167,943 (164.0 KiB) 0 (0.00%)

Raw WebAssembly sections

Section Before After Change
header 8 (0.0 KiB) 8 (0.0 KiB) 0 (0.00%)
type 616 (0.6 KiB) 616 (0.6 KiB) 0 (0.00%)
import 3,257 (3.2 KiB) 3,257 (3.2 KiB) 0 (0.00%)
function 1,079 (1.1 KiB) 1,079 (1.1 KiB) 0 (0.00%)
table 13 (0.0 KiB) 13 (0.0 KiB) 0 (0.00%)
memory 5 (0.0 KiB) 5 (0.0 KiB) 0 (0.00%)
global 27 (0.0 KiB) 27 (0.0 KiB) 0 (0.00%)
export 1,167 (1.1 KiB) 1,167 (1.1 KiB) 0 (0.00%)
element 660 (0.6 KiB) 660 (0.6 KiB) 0 (0.00%)
data count 3 (0.0 KiB) 3 (0.0 KiB) 0 (0.00%)
code 444,191 (433.8 KiB) 444,191 (433.8 KiB) 0 (0.00%)
data 41,470 (40.5 KiB) 41,470 (40.5 KiB) 0 (0.00%)
custom 295 (0.3 KiB) 295 (0.3 KiB) 0 (0.00%)

Code by Rust crate

Crate/function owner Before After Change
Rust standard library 65,470 (63.9 KiB) 65,470 (63.9 KiB) 0 (0.00%)
libdatadog-wasm 58,088 (56.7 KiB) 58,088 (56.7 KiB) 0 (0.00%)
libdd-trace-obfuscation 42,144 (41.2 KiB) 42,144 (41.2 KiB) 0 (0.00%)
zrip-encode 41,358 (40.4 KiB) 41,358 (40.4 KiB) 0 (0.00%)
regex-lite 28,248 (27.6 KiB) 28,248 (27.6 KiB) 0 (0.00%)
libdd-trace-utils 24,499 (23.9 KiB) 24,499 (23.9 KiB) 0 (0.00%)
bindings / unattributed 22,847 (22.3 KiB) 22,847 (22.3 KiB) 0 (0.00%)
http 22,303 (21.8 KiB) 22,303 (21.8 KiB) 0 (0.00%)
rustc-demangle 16,094 (15.7 KiB) 16,094 (15.7 KiB) 0 (0.00%)
serde-json 12,421 (12.1 KiB) 12,421 (12.1 KiB) 0 (0.00%)
hashbrown 11,516 (11.2 KiB) 11,516 (11.2 KiB) 0 (0.00%)
libdd-trace-stats 11,441 (11.2 KiB) 11,441 (11.2 KiB) 0 (0.00%)
rmp 11,039 (10.8 KiB) 11,039 (10.8 KiB) 0 (0.00%)
serde-transcode 10,093 (9.9 KiB) 10,093 (9.9 KiB) 0 (0.00%)
rmp-serde 9,266 (9.0 KiB) 9,266 (9.0 KiB) 0 (0.00%)
anyhow 9,080 (8.9 KiB) 9,080 (8.9 KiB) 0 (0.00%)
dlmalloc 5,071 (5.0 KiB) 5,071 (5.0 KiB) 0 (0.00%)
crossbeam-channel 4,269 (4.2 KiB) 4,269 (4.2 KiB) 0 (0.00%)
rand-chacha 4,267 (4.2 KiB) 4,267 (4.2 KiB) 0 (0.00%)
libdd-trace-protobuf 4,176 (4.1 KiB) 4,176 (4.1 KiB) 0 (0.00%)
bytes 3,875 (3.8 KiB) 3,875 (3.8 KiB) 0 (0.00%)
zrip-core 3,631 (3.5 KiB) 3,631 (3.5 KiB) 0 (0.00%)
fluent-uri 3,463 (3.4 KiB) 3,463 (3.4 KiB) 0 (0.00%)
libdd-common 2,806 (2.7 KiB) 2,806 (2.7 KiB) 0 (0.00%)
libdd-ddsketch 2,403 (2.3 KiB) 2,403 (2.3 KiB) 0 (0.00%)
js-sys 2,390 (2.3 KiB) 2,390 (2.3 KiB) 0 (0.00%)
zmij 2,243 (2.2 KiB) 2,243 (2.2 KiB) 0 (0.00%)
other crates (<2 KiB in both builds) 9,670 (9.4 KiB) 9,670 (9.4 KiB) 0 (0.00%)
remote config: 3 changed, 40 unchanged

Packaged artifact layers

Packaged artifact layer Before After Change
JavaScript glue/loader 29,280 (28.6 KiB) 29,392 (28.7 KiB) +112 (+0.38%)
Final packaged artifacts 336,768 (328.9 KiB) 260,008 (253.9 KiB) -76,760 (-22.79%)
Base64 encoding overhead 76,872 (75.1 KiB) 0 (0.0 KiB) -76,872 (removed)
Raw WASM (before Brotli) 720,147 (703.3 KiB) 720,147 (703.3 KiB) 0 (0.00%)
Brotli-compressed WASM 230,616 (225.2 KiB) 230,616 (225.2 KiB) 0 (0.00%)

Raw WebAssembly sections

Section Before After Change
header 8 (0.0 KiB) 8 (0.0 KiB) 0 (0.00%)
type 574 (0.6 KiB) 574 (0.6 KiB) 0 (0.00%)
import 4,790 (4.7 KiB) 4,790 (4.7 KiB) 0 (0.00%)
function 2,193 (2.1 KiB) 2,193 (2.1 KiB) 0 (0.00%)
table 13 (0.0 KiB) 13 (0.0 KiB) 0 (0.00%)
memory 5 (0.0 KiB) 5 (0.0 KiB) 0 (0.00%)
global 33 (0.0 KiB) 33 (0.0 KiB) 0 (0.00%)
export 1,139 (1.1 KiB) 1,139 (1.1 KiB) 0 (0.00%)
element 1,550 (1.5 KiB) 1,550 (1.5 KiB) 0 (0.00%)
data count 4 (0.0 KiB) 4 (0.0 KiB) 0 (0.00%)
code 629,686 (614.9 KiB) 629,686 (614.9 KiB) 0 (0.00%)
data 79,830 (78.0 KiB) 79,830 (78.0 KiB) 0 (0.00%)
custom 322 (0.3 KiB) 322 (0.3 KiB) 0 (0.00%)

Code by Rust crate

Crate/function owner Before After Change
serde-json 96,377 (94.1 KiB) 96,377 (94.1 KiB) 0 (0.00%)
tuf 96,309 (94.1 KiB) 96,309 (94.1 KiB) 0 (0.00%)
Rust standard library 93,533 (91.3 KiB) 93,533 (91.3 KiB) 0 (0.00%)
libdd-remote-config 79,352 (77.5 KiB) 79,352 (77.5 KiB) 0 (0.00%)
data-encoding 40,626 (39.7 KiB) 40,626 (39.7 KiB) 0 (0.00%)
bindings / unattributed 36,298 (35.4 KiB) 36,298 (35.4 KiB) 0 (0.00%)
http 27,758 (27.1 KiB) 27,758 (27.1 KiB) 0 (0.00%)
hashbrown 25,059 (24.5 KiB) 25,059 (24.5 KiB) 0 (0.00%)
ring 17,349 (16.9 KiB) 17,349 (16.9 KiB) 0 (0.00%)
js-sys 15,849 (15.5 KiB) 15,849 (15.5 KiB) 0 (0.00%)
rustc-demangle 13,732 (13.4 KiB) 13,732 (13.4 KiB) 0 (0.00%)
anyhow 13,201 (12.9 KiB) 13,201 (12.9 KiB) 0 (0.00%)
sha2 10,885 (10.6 KiB) 10,885 (10.6 KiB) 0 (0.00%)
rand-chacha 6,242 (6.1 KiB) 6,242 (6.1 KiB) 0 (0.00%)
serde-wasm-bindgen 5,654 (5.5 KiB) 5,654 (5.5 KiB) 0 (0.00%)
prost 4,955 (4.8 KiB) 4,955 (4.8 KiB) 0 (0.00%)
dlmalloc 4,686 (4.6 KiB) 4,686 (4.6 KiB) 0 (0.00%)
serde 4,254 (4.2 KiB) 4,254 (4.2 KiB) 0 (0.00%)
base64 3,475 (3.4 KiB) 3,475 (3.4 KiB) 0 (0.00%)
libdd-common 3,220 (3.1 KiB) 3,220 (3.1 KiB) 0 (0.00%)
libdd-trace-protobuf 3,126 (3.1 KiB) 3,126 (3.1 KiB) 0 (0.00%)
bytes 2,706 (2.6 KiB) 2,706 (2.6 KiB) 0 (0.00%)
compiler-builtins 2,419 (2.4 KiB) 2,419 (2.4 KiB) 0 (0.00%)
zmij 2,296 (2.2 KiB) 2,296 (2.2 KiB) 0 (0.00%)
other crates (<2 KiB in both builds) 20,319 (19.8 KiB) 20,319 (19.8 KiB) 0 (0.00%)

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant