URL: https://github.com/peterbe/go-bun-compare

tl;dr; Bun is plenty fast to serve as a basic web server that does no I/O. It's even faster than Go using fasthttp.

Doing a "Hello World" benchmark comparison is rather contrived because it's so unrealistic. No server does no I/O. However, it's good to know that if you do need something as simple as this, and need raw performance, you don't need as statically compiled language like Go. Bun is fast enough.

Inspired by this blog post from 2023, I wanted to retry it using Bun 1.3 that came out the other day. Honestly, I was nerdily curious how it would fly on my M4 MacBook Pro.

Check out the code on: https://github.com/peterbe/go-bun-compare

Gist: Bun is slightly faster than Go. By about 15%.

Take it with a pinch of salt. These kinds of benchmarks have flaws because the unrealistic scenario, the lack of logging, and lack of other features such as middleware.

Bonuses

The README has a couple of interesting bonuses such as throwing in Python into the mix.

One that peaked my interest was; how does running a compiled executable, from Bun, compare to running it directly with bun run .... I ran it a bunch of times and noticed that executing it as a single binary made it about 3% faster. Curious!

Comments

Your email will never ever be published.

Previous:
hylite as an executable October 15, 2025 Linux, Bun, TypeScript
Related by category:
Always run biome migrate after upgrading biome August 16, 2025 Bun
Video to Screenshots app June 21, 2025 Bun
Parse a CSV file with Bun September 13, 2023 Bun
How I end-to-end test my Bun CLI app September 18, 2025 Bun
Related by keyword:
Combining Django signals with in-memory LRU cache August 9, 2025 Python, Django
Hello-world server in Bun vs Fastify September 9, 2023 Node, JavaScript, Bun
Fastest way to uniqify a list in Python August 14, 2006 Python
Benchmark compare Highlight.js vs. Prism May 19, 2020 Node, JavaScript