We replaced Node.js with Bun for 5x throughput

pier25 29 points 13 comments April 06, 2026
trigger.dev · View on Hacker News

Discussion Highlights (7 comments)

ksec

>Next: the runtime itself. Bun has a bun build --compile flag that produces a single self-contained executable. No runtime, no node_modules, no source files needed in the container. I didn't know that. So Bun is basically a whole runtime + framework all in one with little to no deployment headaches?

denys_potapov

tl;dr replace SQLite with Map ~ 2x speed up, replace zod validation with ifs ~ 2x speed up. Bun had a memory leak on unresolved promises - now fixed

dcre

I was curious why bun build --compile would be faster. The docs say: “Compiled executables reduce memory usage and improve Bun’s start time. Normally, Bun reads and transpiles JavaScript and TypeScript files on import and require. This is part of what makes so much of Bun “just work”, but it’s not free. It costs time and memory to read files from disk, resolve file paths, parse, transpile, and print source code. With compiled executables, you can move that cost from runtime to build-time.” https://bun.com/docs/bundler/executables#deploying-to-produc...

abustamam

I use bun for everything except for monorepos with isolated deployment targets and shared packages. I use yarn or pnpm for monorepos. Maybe it's changed in the last six months but I could never get docker to properly resolve my dependencies when I only want to build the web app, for example, since the bun lock is deterministic based off of all the packages in the repo so isolating a single leaf makes it error. Maybe I'm doing something wrong but I scoured docs and online and asked multiple AI agents to no avail.

mememememememo

How much would you get by moving to Go, Rust or C++?

azinman2

So is Bun saying that JSC is much better than v8?

mdavid626

Yeah, right. Replaced sqlite with in memory map. Whoa.. it’s faster now.

Semantic search powered by Rivestack pgvector
3,663 stories · 34,065 chunks indexed