The 31% from naming a prepared statement is the number that sticks. Same runtime, same framework, and the ranking moves because the driver was re-parsing every call.
That's the one that reframed the whole piece for me too — the driver re-parsing every call was a tax the other runtimes weren't paying, so part of what looked like "Bun is faster than Node" was really "Bun.SQL prepares automatically and default pg doesn't." Same V8, same framework, and the ranking shifts because of a statement-handling default three layers down from the thing everyone was arguing about.
Two things worth keeping precise about it, because they're where it's easy to overclaim:
It was framework-specific. Ultimate Express jumped 31%; plain Express moved 3%, because Express was already its own bottleneck — the prepared-statement win only shows up when the framework isn't the thing capping you. So "Node got 31% faster" is the wrong takeaway; "the slowest-DB-path stacks got up to 31% back" is the right one.
The win was in database CPU, not Node's. Naming the statement cut Postgres's parse/plan work (~30–37% less DB CPU per request), which is why it didn't close the gap to Bun — the Node stacks were still CPU-bound on the app box. It moved the DB-side ceiling, not the runtime's.
Which is really the article's whole point in miniature: the number moved, nothing anyone was comparing changed, and you only know why if you look at the layer nobody put in the headline. Thanks for reading closely enough to land on that one.
Exactly — "pointed at the wrong layer" is the cleaner way to say it than I managed. The benchmark was measuring the app runtimes, but the thing that moved was work happening on the Postgres box: parse + plan on every call versus once per prepared name. Node's event loop never got faster; it just stopped making the database redo the same homework. The whole point of the piece is that you can run a perfectly fair runtime comparison and still have the result decided by a cost that lives on neither runtime's CPU — so the leaderboard tells you something true and something misleading at the same time, and you can't tell which until you ask where the cycles went.
That's the whole article in one sentence, honestly — "fair runtime comparison, wrong place to look for the cost." Going to be hard not to quote you on that. Thanks for reading it this closely; this was the exact conversation I was hoping the piece would start.
This is spot on and hits right at the core of real-world backend engineering. In so many tech debates, people hyper-focus on raw framework/runtime throughput (like Hello World benchmarks where a micro-framework scores 150k req/s), but the moment you introduce actual I/O, database roundtrips, and connection pooling, the bottleneck shifts completely.
We've seen this exact phenomenon repeatedly:
Connection pool sizing & multiplexing: Tuning connection pool limits and placing PgBouncer (in transaction pooling mode) in front of Postgres regularly yields 2x–3x throughput gains under concurrent workloads—vastly outweighing micro-optimizations between Node and Python runtimes.
Prepared statements & query planning: As highlighted here, naming prepared statements and avoiding re-parsing queries per transaction is a massive lever. Many ORMs default to un-cached queries unless explicitly configured otherwise.
Driver serialization overhead: Bypassing heavy ORM model hydration in favor of lean dictionary/tuple queries with native drivers (like asyncpg in Python or postgres.js) often saves more latency than switching entire frameworks.
Fantastic breakdown and methodology—these are the kind of pragmatic, production-focused benchmarks the community needs more of!
You've basically written the sequel in this comment — the PgBouncer point especially. Transaction-mode pooling is the other place this exact trap hides, and it bites harder with prepared statements, which is a fun irony given this whole article is a love letter to naming them: in transaction pooling mode, server-side prepared statements can break or silently stop being reused, because the statement is prepared on one backend connection and the next transaction gets handed a different one. So you name your statements, feel clever, and PgBouncer quietly hands you back the un-prepared cost you thought you'd eliminated — unless you're on a driver/PgBouncer version that supports prepared statements in transaction mode, or you move the pool in-process. That's the cruelty of this layer: every fix has a second config two levels down that can undo it.
And your third point is the one I wish more people internalized — skipping ORM hydration for lean tuple/dict reads with asyncpg/postgres.js routinely beats a whole framework swap, because the ORM tax (I cite ~57% for SQLAlchemy, ~48% for Prisma in the piece) dwarfs the Node-vs-Python gap people are usually arguing about. You're rebuilding the article's thesis from production scars, which is the best possible endorsement of it. Thanks for the genuinely substantive add.
Appreciate that, Rudratosh! The PgBouncer transaction-mode trap is one of those lessons that burns you the first time you run high-concurrency background workers.
Really enjoyed how cleanly you isolated the single configuration variable without muddying it with other runtime changes. Looking forward to your next benchmark writeup!
Great breakdown. Holding the driver config constant before comparing runtimes is the part most benchmarks skip. I have seen pool settings hide a similar win in production too, where the fix looked like a framework change until someone checked the config. Thanks for showing the numbers and the methodology.
"The fix looked like a framework change until someone checked the config" — that's the exact ghost this article is chasing, and it's expensive precisely because the wrong diagnosis is actionable: a team can spend a quarter migrating off a framework to chase a number that a one-line driver setting would have handed them for free. Holding the config constant isn't just good methodology, it's the thing that tells you whether you're about to do real work or cargo-cult work. Glad the numbers-plus-methodology framing landed — that was the part I most wanted people to take, over any single result. Thanks for reading it closely.
We're a place where coders share, stay up-to-date and grow their careers.
The 31% from naming a prepared statement is the number that sticks. Same runtime, same framework, and the ranking moves because the driver was re-parsing every call.
That's the one that reframed the whole piece for me too — the driver re-parsing every call was a tax the other runtimes weren't paying, so part of what looked like "Bun is faster than Node" was really "Bun.SQL prepares automatically and default
pgdoesn't." Same V8, same framework, and the ranking shifts because of a statement-handling default three layers down from the thing everyone was arguing about.Two things worth keeping precise about it, because they're where it's easy to overclaim:
Which is really the article's whole point in miniature: the number moved, nothing anyone was comparing changed, and you only know why if you look at the layer nobody put in the headline. Thanks for reading closely enough to land on that one.
DB CPU, not the runtime. Same runtimes, different CPU cost, and the comparison was pointed at the wrong layer.
Exactly — "pointed at the wrong layer" is the cleaner way to say it than I managed. The benchmark was measuring the app runtimes, but the thing that moved was work happening on the Postgres box: parse + plan on every call versus once per prepared name. Node's event loop never got faster; it just stopped making the database redo the same homework. The whole point of the piece is that you can run a perfectly fair runtime comparison and still have the result decided by a cost that lives on neither runtime's CPU — so the leaderboard tells you something true and something misleading at the same time, and you can't tell which until you ask where the cycles went.
That parse plus plan on every call versus once per prepared name is the part that sticks. Fair runtime comparison, wrong place to look for the cost.
That's the whole article in one sentence, honestly — "fair runtime comparison, wrong place to look for the cost." Going to be hard not to quote you on that. Thanks for reading it this closely; this was the exact conversation I was hoping the piece would start.
This is spot on and hits right at the core of real-world backend engineering. In so many tech debates, people hyper-focus on raw framework/runtime throughput (like Hello World benchmarks where a micro-framework scores 150k req/s), but the moment you introduce actual I/O, database roundtrips, and connection pooling, the bottleneck shifts completely.
We've seen this exact phenomenon repeatedly:
Fantastic breakdown and methodology—these are the kind of pragmatic, production-focused benchmarks the community needs more of!
You've basically written the sequel in this comment — the PgBouncer point especially. Transaction-mode pooling is the other place this exact trap hides, and it bites harder with prepared statements, which is a fun irony given this whole article is a love letter to naming them: in transaction pooling mode, server-side prepared statements can break or silently stop being reused, because the statement is prepared on one backend connection and the next transaction gets handed a different one. So you name your statements, feel clever, and PgBouncer quietly hands you back the un-prepared cost you thought you'd eliminated — unless you're on a driver/PgBouncer version that supports prepared statements in transaction mode, or you move the pool in-process. That's the cruelty of this layer: every fix has a second config two levels down that can undo it.
And your third point is the one I wish more people internalized — skipping ORM hydration for lean tuple/dict reads with
asyncpg/postgres.jsroutinely beats a whole framework swap, because the ORM tax (I cite ~57% for SQLAlchemy, ~48% for Prisma in the piece) dwarfs the Node-vs-Python gap people are usually arguing about. You're rebuilding the article's thesis from production scars, which is the best possible endorsement of it. Thanks for the genuinely substantive add.Appreciate that, Rudratosh! The PgBouncer transaction-mode trap is one of those lessons that burns you the first time you run high-concurrency background workers.
Really enjoyed how cleanly you isolated the single configuration variable without muddying it with other runtime changes. Looking forward to your next benchmark writeup!
Great breakdown. Holding the driver config constant before comparing runtimes is the part most benchmarks skip. I have seen pool settings hide a similar win in production too, where the fix looked like a framework change until someone checked the config. Thanks for showing the numbers and the methodology.
"The fix looked like a framework change until someone checked the config" — that's the exact ghost this article is chasing, and it's expensive precisely because the wrong diagnosis is actionable: a team can spend a quarter migrating off a framework to chase a number that a one-line driver setting would have handed them for free. Holding the config constant isn't just good methodology, it's the thing that tells you whether you're about to do real work or cargo-cult work. Glad the numbers-plus-methodology framing landed — that was the part I most wanted people to take, over any single result. Thanks for reading it closely.