Skip to content

perf(wasm): rebuild std with immediate-abort panics - #255

Merged
bengl merged 1 commit into
mainfrom
BridgeAR/2026-09-03-wasm-panic-size
Sep 3, 2026
Merged

perf(wasm): rebuild std with immediate-abort panics#255
bengl merged 1 commit into
mainfrom
BridgeAR/2026-09-03-wasm-panic-size

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Sep 3, 2026

Copy link
Copy Markdown
Member

Pins a WASM-only nightly toolchain and rebuilds the Rust standard library with immediate-abort panics. Native builds remain on stable Rust.

The main artifact shrinks from 443,295 to 372,236 bytes (16.0%), reproduced across two clean builds.

Tested by rebuilding both artifacts, running the complete package and type suite, ESLint, and YAML validation.

Setting panic=abort does not remove formatting and unwinding paths already compiled into the standard library. Pin the WASM-only nightly toolchain and rebuild std with immediate-abort panics while leaving native builds on stable Rust.

With the same optimizer and source revision, the main artifact shrinks from 443,295 to 372,236 bytes (16.0%). The measurement reproduced across two clean builds.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Overall package size

Self size: 31.59 MB
Deduped: 31.59 MB
No deduping: 31.59 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:35
@BridgeAR
BridgeAR requested review from a team as code owners September 3, 2026 20:35
@bengl
bengl merged commit 5aa382c into main Sep 3, 2026
53 checks passed
@bengl
bengl deleted the BridgeAR/2026-09-03-wasm-panic-size branch September 3, 2026 20:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a035d12cc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/build-wasm.js
Comment on lines +35 to +39
const cargoPath = childProcess.execFileSync(
'rustup',
['which', 'cargo', '--toolchain', wasmRustToolchain],
{ encoding: 'utf8' },
).trim()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Install the pinned nightly for standalone builds

On developer machines or automation that invokes yarn build-wasm or npm run build:wasm --prefix packages/libdatadog directly, the new nightly is not installed because only .github/actions/setup-wasm performs that step. rustup which --help describes this command as “Display which binary will be run for a given command”; when the pinned toolchain is absent, this call exits nonzero before wasm-pack runs. Thus environments that previously had the stable WASM target configured now require an undocumented manual installation. Install the nightly and its rust-src/WASM components through the standalone build path, or provide an equivalent setup command used by these package scripts.

Useful? React with 👍 / 👎.

BridgeAR added a commit that referenced this pull request Sep 3, 2026
Setting panic=abort does not remove formatting and unwinding paths already compiled into the standard library. Pin the WASM-only nightly toolchain and rebuild std with immediate-abort panics while leaving native builds on stable Rust.

With the same optimizer and source revision, the main artifact shrinks from 443,295 to 372,236 bytes (16.0%). The measurement reproduced across two clean builds.
BridgeAR added a commit that referenced this pull request Sep 4, 2026
* fix(libdatadog): bound active agentless request buffers (#238)

Agentless data-pipeline requests bypass the tracer active request budget, so a slow intake can retain unbounded request bodies. Preserve the 64 MiB process-wide bound and release bytes on completion or cancellation.

(cherry picked from commit 380c8a6)

* chore(deps): bump the patch-updates group across 1 directory with 2 updates (#212)

Bumps the patch-updates group with 2 updates in the / directory: [futures](https://github.com/rust-lang/futures-rs) and [serde](https://github.com/serde-rs/serde).

Updates `futures` from 0.3.32 to 0.3.34
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/main/CHANGELOG.md)
- [Commits](rust-lang/futures-rs@0.3.32...0.3.34)

Updates `serde` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](serde-rs/serde@v1.0.228...v1.0.229)

---
updated-dependencies:
- dependency-name: futures
  dependency-version: 0.3.34
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
- dependency-name: serde
  dependency-version: 1.0.229
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit f9d55fb)

* chore(deps-dev): bump eslint-plugin-n from 17.24.0 to 18.2.2 (#175)

Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.24.0 to 18.2.2.
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md)
- [Commits](eslint-community/eslint-plugin-n@v17.24.0...v18.2.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-n
  dependency-version: 18.2.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit c13eeb3)

* chore(deps-dev): bump the minor-updates group across 1 directory with 2 updates (#190)

Bumps the minor-updates group with 2 updates in the / directory: [eslint](https://github.com/eslint/eslint) and [globals](https://github.com/sindresorhus/globals).

Updates `eslint` from 10.6.0 to 10.9.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](eslint/eslint@v10.6.0...v10.9.1)

Updates `globals` from 17.7.0 to 17.11.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](sindresorhus/globals@v17.7.0...v17.11.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 10.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-updates
- dependency-name: globals
  dependency-version: 17.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit fc69f10)

* chore(deps): bump body-parser from 1.20.4 to 2.3.0 in /test/crashtracker (#140)

Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.20.4 to 2.3.0.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](expressjs/body-parser@1.20.4...v2.3.0)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-version: 2.3.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit c881997)

* perf(capabilities): remove redundant HTTP buffer copies (#242)

Across two fresh Node 22.23.2 / V8 12.4 processes, direct Buffer reuse reduced 46-byte response conversion from 20.9–21.0 ns to 6.1–6.2 ns.

Parsing the existing request-head Buffer reduced 71.2–71.8 ns to 32.5–32.8 ns in the same seven-trial benchmark.

(cherry picked from commit 12991d8)

* chore(deps-dev): bump eslint-plugin-unicorn to 74 (#240)

* chore(deps-dev): bump eslint-plugin-unicorn to 71.1.0

The updated recommended preset adds opinionated checks that conflict with Node 18 support and established runtime patterns. Keep its correctness checks enabled and align the deliberate exceptions with dd-trace-js.

Refs: #162

* chore(deps-dev): update eslint-plugin-unicorn to 74.0.0

The latest recommended preset adds style and parsing diagnostics. Align the project exceptions with dd-trace-js and keep the remaining checks enabled.

(cherry picked from commit 7bc0b3c)

* refactor(libdatadog): use callbacks for agentless transport (#239)

* refactor(libdatadog): use callbacks for agentless transport

The public callback API still crossed Promise-based host and WASM boundaries, which left two completion models for each export. Rust keeps retry and cancellation ownership; the final callback preserves the caller's async context.

Active-buffer admission completes as a local drop. A network error would retain the discarded payload through the Rust retry backoff.

* refactor(libdatadog): leave export context to callers

dd-trace enters every export inside its no-tracing context, so libdatadog does not need to restore caller context.

(cherry picked from commit 6dd6ce9)

* ci: reuse release proposal artifacts (#237)

* ci: reuse release proposal artifacts

Stable releases rebuild native and WASM artifacts after the proposal checks finish, so npm can receive binaries that CI did not test. Bind one candidate bundle to the merged Git tree and stop the release when that bundle is unavailable.

Refs: #236

* ci: simplify release artifact lookup

The release only needs proof that the proposal run tested the merged tree, because it downloads the immutable artifacts from that run.

* ci: pin release candidate artifact

The release workflow can start before the proposal artifacts exist. Reruns also retain the run ID, so separate name-based downloads can mix build attempts.

A stable release must use one complete bundle that matches the tree and merged same-repository head.

(cherry picked from commit 20ebef2)

* chore(deps): upgrade napi-rs to v3 (#244)

napi and napi-derive must use the same major. Updating either crate alone leaves generated bindings incompatible with the runtime API and breaks every native build.

(cherry picked from commit 5998158)

* fix(ci): resolve release artifacts by candidate tree (#246)

Pull-request workflows can build from synthetic merge commits, so workflow_run.head_sha can differ from the PR source head. Filtering an already tree-qualified artifact by that SHA prevents stable releases from finding it.

* fix(crashtracker): preserve cross-context exception metadata (#257)

Errors created in another V8 context fail the main context's instanceof Error check, so uncaught exception reports lose their structured type, message, and stack frames. The Node-API check recognizes these errors, while the existing instanceof fallback preserves transparent proxy behavior.

* chore: remove obsolete repository residue (#247)

Root sketch and zstd checks became unreachable when their bindings moved to the universal package, which already tests both capabilities.

The WASM matrix now uses the checksum-verified setup shared with the universal package.

* refactor(process-discovery): accept metadata objects (#248)

`dd-trace` still calls the positional `TracerMetadata` constructor, so a small factory preserves that contract while `storeMetadata` moves to plain objects.

* bench(agentless): add end-to-end pipeline workloads (#250)

Build the measured WASM artifact first and stop timing at the generated request callback so transport latency cannot hide transformation and compression costs.

* perf(wasm): rebuild std with immediate-abort panics (#255)

Setting panic=abort does not remove formatting and unwinding paths already compiled into the standard library. Pin the WASM-only nightly toolchain and rebuild std with immediate-abort panics while leaving native builds on stable Rust.

With the same optimizer and source revision, the main artifact shrinks from 443,295 to 372,236 bytes (16.0%). The measurement reproduced across two clean builds.

* fix(capabilities): reject incomplete HTTP responses (#249)

An incomplete HTTP response emits 'aborted' without 'end', so the transport promise and its Remote Config poll remain pending.

* feat(libdatadog): accept a borrowed transport agent (#259)

* feat(libdatadog): accept a borrowed transport agent

The exporter cancels its own requests on close but leaves the caller-owned agent alive.

* fix(libdatadog): honor borrowed transport agents

An unconditional Connection: close header prevents keep-alive agents from reusing sockets. The transport option also accepted objects without Node's required addRequest method, so invalid values failed on the first export.

* v0.21.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bengl pushed a commit that referenced this pull request Sep 4, 2026
Setting panic=abort does not remove formatting and unwinding paths already compiled into the standard library. Pin the WASM-only nightly toolchain and rebuild std with immediate-abort panics while leaving native builds on stable Rust.

With the same optimizer and source revision, the main artifact shrinks from 443,295 to 372,236 bytes (16.0%). The measurement reproduced across two clean builds.
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.

2 participants