Skip to content

revert: single-binding ContextFrame representation; version 0.3.1 - #28

Merged
miinhho merged 1 commit into
mainfrom
revert/single-binding-frame
Sep 12, 2026
Merged

miinhho merged 1 commit into
mainfrom
revert/single-binding-frame

Conversation

@miinhho

@miinhho miinhho commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Reverts the SingleBinding frame representation from #26 and bumps to 0.3.1. No public behavior change.

Why

Measured on its own (2M iterations):

Node 24 Bun
new Map() + one set 26 ns 47 ns
dedicated single-binding object 8 ns 9 ns

20–40 ns per Job — under 3% of a Job, below anything measurable end to end. That was bundled into #26 with two changes that are 5–10× larger and was carried by their aggregate, not by its own number. It leaves a permanent cost: two representations behind ContextFrame that every future change to frames must keep in step across from, with, and withEntries.

The one hot consumer — the server binding ContainerKey per request — now hosts its scope on the Runner attachment and creates no per-request frame at all (tiberjs/manager#3), so the one-binding case is no longer on any hot path.

Verification

pnpm format, pnpm check, pnpm build, pnpm test (131). Per-Job microbenchmark unchanged within noise (plain Job 0.85 µs, server-shape HandoffJob 1.30 µs on Node).

Related: #25, #26

Measured alone, one binding as a Map costs 26 ns (Node) / 47 ns (Bun) to
create against 8-9 ns for a dedicated object: 20-40 ns per Job, under 3%
of a Job and invisible end to end. That does not pay for a second frame
representation kept in step across three constructors. The consumer that
created a one-binding frame per request now hosts its scope on the
attachment instead (tiberjs/manager#3), so the case is no longer hot.
@miinhho
miinhho merged commit d49faa0 into main Sep 12, 2026
1 check passed
@miinhho
miinhho deleted the revert/single-binding-frame branch September 12, 2026 10:02
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