From c5a8361c14218340ecbf6bef7fc6d0183bcaa221 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Tue, 22 Sep 2026 14:14:02 -0500 Subject: [PATCH] docs(bench): record the 26.9.0-beta.2 release gate, and drop a claim it never supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The breaking changes in this release — `Plugin` as `{ name, mount }`, async `serveDeno`/`serveBun`, a teapot that cannot export a provider, an `HttpError` recognised by brand — are boot-time and error-path work, so the question was whether any of it reached the per-request path. Ten cases against `v26.9.0-beta.1`, both trees on one box in one sitting with the order alternating: nine overlap and say nothing, which is the answer. The tenth is the part worth keeping. `param, 50 routes` came out +4.3% with separated ranges, in our favour, and had no mechanism — the matcher work that could produce it would have to show at 200 routes, where the same run said +0.1%. Seven rounds put it at +0.5% and overlapping. It was chance, and it is recorded as chance, because a flagged row means measure again in either direction. The README has claimed since 7 July that green-tea beat every other framework in 3 of 4 scenarios. The table it links to stopped saying that at some point over the following two months — a ranking written into prose once is a claim nobody re-measures, and this one outlived the NestJS rows, the parity controls and the runtime-neutral boundary the file itself documents the cost of. It is replaced by the shape of the result, which is stable, and a pointer to the table for the numbers, which are not. The cross-framework tables are deliberately left at their 2026-09-02 date. Two attempts to regenerate them produced runs where a framework's delta tracked its position in the run order and a browser held ~60% of the machine; publishing those would have read as green-tea overtaking Fastify, which is the most flattering available reading of a broken measurement. Absolute numbers need a quiet box. Signed-off-by: Diego Resendez --- BENCHMARKS.md | 42 ++++++++++++++++++++++++++++++++++++++++++ README.md | 8 +++++--- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/BENCHMARKS.md b/BENCHMARKS.md index 644bc89..bb6a85d 100644 --- a/BENCHMARKS.md +++ b/BENCHMARKS.md @@ -136,6 +136,48 @@ was benchmarked as it landed — the numbers are still in the code, cited below file between `26.7` and `26.9`, so nothing added them up. That is the gap this section and `npm run bench:compare` exist to close. +### The release gate: `26.9.0-beta.1` → `26.9.0-beta.2` + +Ten cases, both trees on one box in one sitting, alternating which side ran first each round, sharing +one `node_modules` — the two revisions differ by a version string and nothing else in `package.json`, +so the only thing that moved between the sides is green-tea. Medians of three rounds: + +| Scenario | 26.9.0-beta.1 | 26.9.0-beta.2 | Δ | | +| --- | --- | --- | --- | --- | +| hello | 90,615 | 89,853 | −0.8% | overlaps | +| param | 86,956 | 87,572 | +0.7% | overlaps | +| pipeline (3 steps) | 80,061 | 81,504 | +1.8% | overlaps | +| steps5 | 75,436 | 75,238 | −0.3% | overlaps | +| validate (POST) | 70,240 | 73,568 | +4.7% | overlaps | +| hello + security | 83,738 | 84,890 | +1.4% | overlaps | +| hello + cors predicate | 82,237 | 82,528 | +0.4% | overlaps | +| preflight + cors predicate | 111,223 | 114,220 | +2.7% | overlaps | +| param, 50 routes | 83,505 | 87,078 | +4.3% | **flagged** | +| param, 200 routes | 73,289 | 73,335 | +0.1% | overlaps | + +Nine rows overlap and therefore say nothing, which is the result this gate exists to produce. The +release is a breaking one — `Plugin` became `{ name, mount }`, `serveDeno()` and `serveBun()` became +async, `@Provider({ export: true })` stopped being a thing a teapot can do, and an `HttpError` is now +recognised by a brand rather than by `instanceof` — but all of that is boot-time or error-path work. +None of it sits on the per-request path these cases walk, and the table agrees. + +The tenth row is why "flagged" is not a synonym for "found something". `param, 50 routes` came out ++4.3% with separated ranges, in green-tea's favour, and it did not survive being asked twice: re-run +alone at seven rounds it is **+0.5% and overlapping**, with both sides swinging between 80,794 and +88,259 req/s. The reason to doubt it before re-running was that it had no mechanism — the matcher +work that could produce it would have to show at 200 routes too, and that row had already said ++0.1%. Treat a flagged row as an instruction to measure again, whichever direction it points; a win +nobody can explain is a measurement problem more often than it is a win. + +The cross-framework tables above were **not** regenerated for this release, and their date says so. +Two attempts produced numbers this box cannot stand behind: each framework's delta against the +previous run tracked its position in the run order rather than anything in its code — the framework +measured second lost 7%, the ones measured last gained — and a browser and the window server were +taking around 60% of the machine throughout. Reporting that as "green-tea overtook Fastify" would +have been the most flattering available reading of a broken measurement, which is exactly the kind +this file exists to refuse. The gate table above survives the same contention, because both sides +pay it and the order alternates; an absolute cross-framework number does not, and needs a quiet box. + ### The release gate: `26.8.0-beta.1` → `26.9.0-beta.1` Both trees measured on one box in one sitting, alternating which side ran first each round, sharing diff --git a/README.md b/README.md index 68daa94..d917297 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ npm install busboy # multipart/form-data file uploads - **The type is the contract.** What a handler reads from the context *is* its dependency list. In the typed `flow` core, a handler that reads `ctx.user` **fails to compile** if no step produces `user`. *Why it matters:* whole classes of "it was undefined in prod" disappear at compile time. - **You can see the request before it runs.** `app.explain('/users/:id')` prints the ordered chain with origins; `app.graph()` / `GET /__graph__` render it as a live diagram; `app.openapi()` projects the same metadata into an OpenAPI 3.1 spec. *Why it matters:* onboarding, debugging, audits, and API docs are reading, not archaeology. (NestJS puts the graph behind a paid Devtools plan.) - **One primitive for real-time.** Declare the transport — SSE, ndjson, or a WebSocket duplex — and return an `AsyncIterable`; backpressure and cleanup are handled. *Why it matters:* no separate gateway, adapter, or library to bolt on. -- **The same app runs on Node, Deno, Bun, and the edge.** One codebase, one import; you swap the entry point (`app.listen` → `serveDeno` / `serveBun` / `edgeHandler`) and nothing else. HTTP, SSE, and WebSocket — including rooms and channels — behave identically on all four. *Why it matters:* the graph model isn't a bet on one runtime's future, and no other opinionated/DI framework runs everywhere. +- **The same app runs on Node, Deno, Bun, and the edge.** One codebase, one import; you swap the entry point (`await app.listen()` → `await serveDeno()` / `await serveBun()` / `edgeHandler`) and nothing else — each one boots the app before it binds, so a provider that cannot start fails the deploy instead of answering `500`s from a port that looks healthy. HTTP, SSE, and WebSocket — including rooms and channels — behave identically on all four. *Why it matters:* the graph model isn't a bet on one runtime's future, and no other opinionated/DI framework runs everywhere. - **A remote dependency looks like a local one.** `@needs('billing')` resolves the same whether `billing` lives in this process or on another node (mesh, experimental). *Why it matters:* no gRPC layer or message-pattern DSL to learn — there's the graph, and some nodes happen to live elsewhere. - **Plugins can't sabotage you.** A plugin is `{ name, mount(api) }`. It gets `bus.on(...)` (observe), `scope.add(...)` (extend its own scope) and `onShutdown(...)` (release what it opened). There is no API to reorder or delete another scope's steps. *Why it matters:* installing a plugin can't break your body parser. @@ -153,7 +153,9 @@ without growing the runtime dependency tree past `reflect-metadata`: We built a reproducible [autocannon harness](./BENCHMARKS.md) comparing green-tea to Express 5, Fastify 5, NestJS (on both Express and Fastify), and raw Node `http` — and we wrote it to be **hard on ourselves**, not flattering. -On that harness, **green-tea handled more requests per second than every other framework in 3 of 4 scenarios** (JSON response, routing, and body-parsing-plus-validation), behind only raw `http` with no framework at all. In the fourth (a multi-step pipeline) it lands even with Fastify. +On that harness green-tea lands in the fast group on Node — with Fastify and NestJS-on-Fastify, and behind raw `http` with no framework at all — and Express and NestJS-on-Express are roughly 3× back. Which member of that fast group tops a given scenario moves between runs by more than the gap between them, so the table below is the answer and a sentence here is not — a ranking written into a README once is a claim that stops being re-measured, and ends up contradicting the file it links to. + +The question a release actually has to pass is the other one — *did the last N commits cost anything* — and comparing today's numbers against a table generated weeks ago answers it with two machines in a mood rather than two versions. `npm run bench:compare` runs both trees on one box in one sitting, alternating sides; `26.9.0-beta.1 → 26.9.0-beta.2` came out flat on every case. Read the honest caveats in [BENCHMARKS.md](./BENCHMARKS.md): the numbers are single-box + loopback (absolute throughput is overstated and differences compressed — trust the *ratios*), the cross-framework table runs green-tea with `security:false` for header parity, and the real cost of secure-by-default is measured separately. Regenerate any time with `npm run bench`. @@ -288,7 +290,7 @@ green-tea is **beta**, on the road to a release candidate. Express and Fastify h **What a teapot exports: steps and routes, and nothing else.** A `@Provider` marked `export: true` fails the boot with an error that says why — a provider's value *is* the object it builds, a pool or a client or a `db`, and the mesh moves data, not objects. Export a `@Step` instead: it runs on the teapot, per request, and its result is what comes back. That is also what lets a teacup boot without its teapot: a remote step holds nothing between requests, so a teacup whose teapot never answers still starts once the `bootTimeoutMs` grace runs out — it warns and carries on. Be precise about what that means, because it is narrower than it sounds. A teapot that never connected sent no manifest, so nothing of it reached the graph: its routes **404** rather than `503`, since nothing was registered to match, and a local step that `@needs` one of its tokens **still fails the boot**, naming the teapot that did not connect. That failure is deliberate — it is the check that catches a typo in a token name, which no amount of waiting will fix. `503` is what you get from a teapot that connected and *later* died, where the link and its exports do exist. So what the change buys is the teacup that does *not* depend on that teapot starting anyway, rather than refusing over a dependency it never had. Keeping a *needed* token serving while its teapot is legitimately away is a known gap, not an oversight: the intended answer is the `expects` list in [the mesh degrade plan](./docs/plans/2026-08-18-mesh-degrade-plan.md), which is planned and not built. -**What is settled, and what is still moving.** Present state, not a roadmap and not the API freeze — this is spare-time work by one person, and a schedule it cannot keep would cost more than it earns. The **graph is the settled part**: `needs`/`provides`, the order derived from them, and the boot-time failure when nothing provides a key have not changed since the beta hardening on 7 July, and `@Provider`, `@Step`, `@Route` and handler shapes still mean what they meant then — the decorator *set* has grown (`@Head`, `@Options`, `@Html`), which only ever adds. **Still moving:** the plugin API, which became `{ name, mount }` and gained `onShutdown`; `createApp`'s options, which gain fields most months; and the pipeline context, which in July became one object mutated in place rather than copied per step — so a step that captured it now sees later steps' writes. **Alpha:** mesh, above. Legacy decorators are a standing *external* risk rather than a green-tea one — see [Why legacy decorators](#why-legacy-decorators). The [matcha](https://github.com/Expressive-Tea/matcha) CLI ships from its own repository on its own version line, so nothing here speaks for it. +**What is settled, and what is still moving.** Present state, not a roadmap and not the API freeze — this is spare-time work by one person, and a schedule it cannot keep would cost more than it earns. The **graph is the settled part**: `needs`/`provides`, the order derived from them, and the boot-time failure when nothing provides a key have not changed since the beta hardening on 7 July, and `@Provider`, `@Step`, `@Route` and handler shapes still mean what they meant then — the decorator *set* has grown (`@Head`, `@Options`, `@Html`), which only ever adds. **Still moving:** the plugin API, which became `{ name, mount }` and gained `onShutdown`; the runtime entry points, where `serveDeno()` and `serveBun()` became async so they boot before they bind; `createApp`'s options, which gain fields most months; and the pipeline context, which in July became one object mutated in place rather than copied per step — so a step that captured it now sees later steps' writes. **Alpha:** mesh, above. Legacy decorators are a standing *external* risk rather than a green-tea one — see [Why legacy decorators](#why-legacy-decorators). The [matcha](https://github.com/Expressive-Tea/matcha) CLI ships from its own repository on its own version line, so nothing here speaks for it. ## Docs & development