Skip to content

perf: reduce monitoring and MessagePack decoding overhead - #194

Merged
egeominotti merged 2 commits into
mainfrom
perf-stability-optimizations
Nov 15, 2026
Merged

egeominotti merged 2 commits into
mainfrom
perf-stability-optimizations

Conversation

@egeominotti

@egeominotti egeominotti commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Two repeated costs remain in the queue hot paths: idle monitoring rescans every active job for each queue, and MessagePack prototype-key detection scans frame bytes in JavaScript. This change aggregates active counts within a monitoring pass, invalidating them after synchronous callbacks, and uses a bounded native Buffer search before the existing safe decoder path.

Native alternating A/B measurements found 12.38% less time for a 2,000-job TCP PUSH/PULL/ACK sequence with 64 KiB payloads. Event-free monitoring passes improved 25.23x at 100 queues/10,000 active jobs and 321.78x at 1,000 queues/100,000 active jobs. These are workload-specific results; single-queue monitoring added about 24 ns, and small-payload results were inconclusive. The faster SQLite batching prototype was rejected because it changed failure and durability boundaries; SQLite runtime is unchanged.

The engineering article, technical report, captured samples, checksums, exact runtime patch, and reproduction harnesses accompany the two runtime changes. No existing test, fixture, runner, or test configuration was changed: all 1,558 protected paths remain byte-identical.

Validation on the retained runtime:

  • bun run test:sandbox: unit 11,931 pass / 0 fail / 404 skip; TCP 553/0; embedded 349/0; no anomalies.
  • bun run test:sandbox:sdk: 1,557 pass / 0 fail / 3 skip across all six external SDK suites; no anomalies or survivors.
  • Fresh disposable Ubuntu 24.04 native Machine: unit 12,062/0/404, TCP 553/0, embedded 349/0, tinyfs 9/0; deleted after validation.
  • Isolated bun run test:model: 12/0 with 100,418 assertions, seed 20261115.
  • bun run typecheck, bun run format:check, ./init.sh, immutable-file checks, and whitespace checks passed.
  • Post-gate delta is documentation/state only; 408 existing documentation/harness checks passed. Site build and discovery validation passed, with article/index/RSS/sitemap/OG/download checks.

No package version bump or package publication is included. Full provenance and limitations are in docs/benchmarks/performance-stability-2026-11-15.md.

Source commit 009f20df passed CI run 43736304149 on attempt 1: all 26 CI jobs succeeded, with nine expected release skips. Unit tests: 12,066 pass / 0 fail / 400 skip; TCP: 553/553; PostgreSQL 16/17/18.6: 571 pass / 0 fail / 1 skip each. A documentation/state-only closure records these results without changing executable source or tests.

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 15, 2026 4:51pm UTC

@claude

claude Bot commented Nov 15, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@egeominotti
egeominotti merged commit bf559e5 into main Nov 15, 2026
39 checks passed

This branch was successfully deployed

1 active deployment
Preview — d2579ee3 Deployed Nov 15, 2026 by vercel[bot]
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