Lädt...


🔧 Hono.js Benchmark: Node.js vs. Deno 2.0 vs. Bun — Which Is the Fastest?


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Deno 2.0 just came out and claimed to be faster than Bun and Node.js and the same way Bun claims to be quicker. This caught my interest, so I decided to put their performance to the test and see how they compare in a real-world scenario.

For a fair comparison, I need to choose a framework compatible with all three JavaScript runtime environments (Node.js, Deno, and Bun). That’s why I decided to use Hono.js, which integrates seamlessly with all three.

Test Environment:

OS: Ubuntu 24.04.1 LTS (WSL)
System: Ryzen 5 5500U, 16GB RAM
Node.js: v22.9.0
Deno: v2.0.0
Bun: v1.1.30

Test Command:

bombardier -c 100 -d 30s http://localhost:3000

For benchmarking, I used Bombardier, a Go-based load testing tool that runs for 30 seconds with 100 concurrent connections. Each test was repeated three times to ensure more accurate results, and the average of these runs was taken for each environment.

The Framework: Hono.js

I selected Hono.js for its flexibility and cross-compatibility. Hono.js allows easy integration with all three JavaScript runtimes — Node.js, Deno, and Bun — making it an ideal framework for this kind of benchmark. It’s lightweight, fast, and has a simple API, which ensures that the performance differences between the runtimes are highlighted without much overhead.

Result

Here are the average and maximum requests per second for each runtime:

Request per second of Node.js vs Deno 2.0 vs Bun(Request/sec)
Winner: Bun

Here are the latency (in milliseconds per request) for each runtime is shown below:

Latency per second of Node.js vs Deno 2.0 vs Bun(ms/req)
Winner: Bun (Avg) & Deno (Max)

Analysis and Key Takeaways
Based on the results, the following key points emerged:

Node.js: While Node.js has been the industry standard for server-side JavaScript for years, it shows lower performance in terms of requests per second when compared to both Deno and Bun. Its average latency is also higher, suggesting that it may struggle more under heavy concurrent loads. However, Node.js is still widely adopted for its vast ecosystem and stability in production environments.

Deno 2.0: Deno performed significantly better than Node.js, delivering more than double the requests per second while maintaining a much lower average latency. This indicates that Deno is highly optimized for handling concurrent connections and could be a strong alternative for performance-critical applications. Its modern design and built-in features like TypeScript support give it an edge in newer projects.

Bun: Bun outperformed both Node.js and Deno in terms of raw performance. It handled the highest number of requests per second and maintained the lowest average latency. This makes Bun a compelling option for projects where speed is the top priority. However, it is still a newer runtime, and its ecosystem and community are not yet as mature as those of Node.js.

Conclusion

In this benchmark, I tested the performance of Deno 2.0, Bun, and Node.js using Hono.js as the framework across all three environments. The results clearly show that both Deno and Bun outperform Node.js in terms of raw speed and latency. Bun, in particular, shines in high-performance scenarios, while Deno provides a balanced solution with a focus on modern development features.

While Node.js may not be the fastest option, it remains a reliable choice, especially for projects that rely on its mature ecosystem. On the other hand, if you’re working on a new project and need to maximize performance, both Deno and Bun offer compelling alternatives.

Ultimately, the choice of runtime will depend on your project’s specific needs. For now, Deno and Bun have proven themselves as the new contenders in the JavaScript runtime race, with Bun taking a noticeable lead in performance.

...

🔧 Hono.js Benchmark: Node.js vs. Deno 2.0 vs. Bun — Which Is the Fastest?


📈 92.49 Punkte
🔧 Programmierung

🔧 Deno vs Node.js: Is Deno Really the Better Node?


📈 47.67 Punkte
🔧 Programmierung

🔧 Node vs Deno vs Bun: Comparing JavaScript Runtimes


📈 42.17 Punkte
🔧 Programmierung

🔧 How to use the Fetch API in Node.js, Deno, and Bun


📈 42.17 Punkte
🔧 Programmierung

📰 Die neue JavaScript-Runtime Bun fordert Node, Deno & Co. heraus


📈 42.17 Punkte
📰 IT Nachrichten

📰 Node.js Rival Deno Gets Seed Capital For Full-time Deno Engineers


📈 40.71 Punkte
📰 IT Security Nachrichten

🔧 Easy and Fast API Development with Bun and Hono: A Simple Project in 5 Minutes


📈 38.93 Punkte
🔧 Programmierung

🔧 [Hono] Simple Messaging App using Bun and WebSocket


📈 38.93 Punkte
🔧 Programmierung

🔧 Easy to Dev a Gpts Chat APP with hono bun htmx


📈 38.93 Punkte
🔧 Programmierung

🔧 Node.js Frameworks Roundup 2024 — Elysia / Hono / Nest / Encore — Which should you pick?


📈 35.28 Punkte
🔧 Programmierung

🔧 Deno 2.0 vs Bun: The Battle of Modern JavaScript Runtimes


📈 35.22 Punkte
🔧 Programmierung

🔧 Deno or Bun? Or NodeJs?


📈 35.22 Punkte
🔧 Programmierung

🔧 AWS Lambda in Deno or Bun


📈 35.22 Punkte
🔧 Programmierung

🔧 Deno vs Bun: The Evolution of JavaScript Runtimes and NPM Integration


📈 35.22 Punkte
🔧 Programmierung

🔧 Exploring Bun.js Over Deno: A Humble Developer's Tale


📈 35.22 Punkte
🔧 Programmierung

🔧 Có thể bạn chưa biết (Phần 1)


📈 34.69 Punkte
🔧 Programmierung

🔧 Tìm Hiểu Về RAG: Công Nghệ Đột Phá Đang "Làm Mưa Làm Gió" Trong Thế Giới Chatbot


📈 34.69 Punkte
🔧 Programmierung

🔧 Deno Fresh PostCSS: Future CSS with Deno


📈 33.75 Punkte
🔧 Programmierung

🔧 Creating a Hono Node.js API: A Step-by-Step Guide


📈 27.55 Punkte
🔧 Programmierung

🔧 Create a Node Server using Hono


📈 27.55 Punkte
🔧 Programmierung

🔧 Elevate Your Node.js Experience: Migrating from Express to Hono


📈 27.55 Punkte
🔧 Programmierung

🔧 When to Use Bun Instead of Node.js


📈 25.3 Punkte
🔧 Programmierung

🔧 The Advantages of Bun: When to Choose it Over Node.js 🔥


📈 25.3 Punkte
🔧 Programmierung

🔧 Node Test Runner vs Bun Test Runner (with TypeScript and ESM)


📈 25.3 Punkte
🔧 Programmierung

🔧 Node.js? More Like No-Go Slow! Bun.js and Elysia.js to the Rescue ✨


📈 25.3 Punkte
🔧 Programmierung

🔧 Rescuing legacy Node.js projects with Bun


📈 25.3 Punkte
🔧 Programmierung

🔧 From Node to Bun: A New Dawn for JavaScript Engines?


📈 25.3 Punkte
🔧 Programmierung

🔧 Bun or Node.js in 2024?


📈 25.3 Punkte
🔧 Programmierung

📰 (g+) Javascript: Bun greift nach dem Platz von Node.js


📈 25.3 Punkte
📰 IT Nachrichten

🎥 Bun Tutorial – JavaScript Runtime (Node.js Alternative) [Full Course]


📈 25.3 Punkte
🎥 Video | Youtube

🔧 Runtime challenge: Bun vs Node


📈 25.3 Punkte
🔧 Programmierung

🔧 Bun: A Faster, Modern Alternative to Node.js for JavaScript Development


📈 25.3 Punkte
🔧 Programmierung

🔧 ⚔️ Rust vs Go vs Bun vs Node.js: The Ultimate 2024 Performance Showdown 🚀


📈 25.3 Punkte
🔧 Programmierung

🔧 ⚡Mencoba Komparasi Seberapa Kencang Performa Bun dibandingkan Node


📈 25.3 Punkte
🔧 Programmierung

matomo