<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yogesh Rathod</title>
    <description>The latest articles on DEV Community by Yogesh Rathod (@yogeshhrathod).</description>
    <link>https://dev.to/yogeshhrathod</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F594459%2Fea53a5ac-9ec9-446e-9af8-025eee7156c4.jpeg</url>
      <title>DEV Community: Yogesh Rathod</title>
      <link>https://dev.to/yogeshhrathod</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yogeshhrathod"/>
    <language>en</language>
    <item>
      <title>Deno vs Bun vs Node.js: Performance &amp; Benchmarks</title>
      <dc:creator>Yogesh Rathod</dc:creator>
      <pubDate>Thu, 06 Mar 2025 18:06:19 +0000</pubDate>
      <link>https://dev.to/yogeshhrathod/deno-vs-bun-vs-nodejs-performance-benchmarks-3e1n</link>
      <guid>https://dev.to/yogeshhrathod/deno-vs-bun-vs-nodejs-performance-benchmarks-3e1n</guid>
      <description>&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;Performance is a critical factor when choosing a JavaScript runtime. This document compares &lt;strong&gt;Deno&lt;/strong&gt;, &lt;strong&gt;Bun&lt;/strong&gt;, and &lt;strong&gt;Node.js&lt;/strong&gt; based on execution speed, startup time, HTTP request handling, and other key benchmarks.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Performance Comparison
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Startup Time
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bun&lt;/strong&gt; has the fastest startup time due to its optimized JavaScript engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deno&lt;/strong&gt; is faster than Node.js, thanks to Rust's efficient memory management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt; has slower startup times due to legacy design choices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.2 HTTP Server Performance
&lt;/h3&gt;

&lt;p&gt;To test real-world performance, I implemented a custom &lt;strong&gt;HTTP application server&lt;/strong&gt; that generates mock data based on configuration settings. I ran the server using &lt;strong&gt;Node.js 22&lt;/strong&gt;, &lt;strong&gt;Deno 2.0&lt;/strong&gt;, and &lt;strong&gt;Bun 1.2.0&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Benchmark Results (Requests Per Second - RPS)
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Runtime&lt;/th&gt;
&lt;th&gt;RPS (higher is better)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Node.js 22&lt;/td&gt;
&lt;td&gt;30,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deno 2.0&lt;/td&gt;
&lt;td&gt;38,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bun 1.2.0&lt;/td&gt;
&lt;td&gt;58,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bun 1.2.0&lt;/strong&gt; delivered the highest RPS, showcasing its speed advantage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deno 2.0&lt;/strong&gt; outperformed Node.js significantly, handling more concurrent requests efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js 22&lt;/strong&gt; performed well but was the slowest among the three.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.3 File System Operations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bun&lt;/strong&gt; is optimized for fast file reads and writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deno&lt;/strong&gt; performs better than Node.js in handling file system tasks due to Rust’s efficiency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt; has good file I/O performance but lags behind Bun and Deno in direct comparisons.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.4 Package Management Speed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bun&lt;/strong&gt; installs and executes npm packages significantly faster than both Deno and Node.js.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deno&lt;/strong&gt; has built-in module handling but is slower than Bun for npm compatibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt; uses npm, which is the slowest in package installation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Benchmarks Summary
&lt;/h2&gt;

&lt;p&gt;The following are updated benchmark results:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Node.js 22&lt;/th&gt;
&lt;th&gt;Deno 2.0&lt;/th&gt;
&lt;th&gt;Bun 1.2.0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Startup Time&lt;/td&gt;
&lt;td&gt;120ms&lt;/td&gt;
&lt;td&gt;80ms&lt;/td&gt;
&lt;td&gt;5ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP Requests (RPS)&lt;/td&gt;
&lt;td&gt;30k&lt;/td&gt;
&lt;td&gt;38k&lt;/td&gt;
&lt;td&gt;58k&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File Read Speed&lt;/td&gt;
&lt;td&gt;50ms&lt;/td&gt;
&lt;td&gt;40ms&lt;/td&gt;
&lt;td&gt;25ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm Package Install&lt;/td&gt;
&lt;td&gt;Slow&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  4. Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bun&lt;/strong&gt; is the fastest in almost every category, making it ideal for performance-intensive applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deno&lt;/strong&gt; offers better performance than Node.js, particularly in concurrent tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js&lt;/strong&gt; remains stable but is the slowest of the three.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If performance is your main concern, &lt;strong&gt;Bun&lt;/strong&gt; is the best choice, followed by &lt;strong&gt;Deno&lt;/strong&gt;, with &lt;strong&gt;Node.js&lt;/strong&gt; still being a reliable option for legacy applications.&lt;/p&gt;

&lt;p&gt;My custom &lt;strong&gt;HTTP server&lt;/strong&gt; saw a significant performance boost when switching from &lt;strong&gt;Node.js 22 to Deno 2.0 and Bun 1.2.0&lt;/strong&gt;, highlighting how modern runtimes optimize execution and request handling.&lt;/p&gt;

</description>
      <category>node</category>
      <category>bunjs</category>
      <category>deno</category>
    </item>
  </channel>
</rss>
