Deno vs Node performance comparison: HTTPS echo name
This is an outdated article. The updated article can be read here.
Introduction
This article is a long overdue update to one of the initial articles here. It’s been more than a year since the hello world comparison was done (right after Deno v1.0 was released). The article was updated two times to keep up with the latest releases of Deno & Node. In Deno world, things have changed significantly since the last update. There is a new, stable & performant native HTTP server in Deno. It’s the perfect time to take a fresh look at the performance comparison.
Configuration
Environment
The performance comparison is executed on the following environment:
- System: MacBook with Intel Core i5 & 8G of memory
- Local: The SUT and tester are on the same system
- Deno version: 1.14.1
- Node version: 16.10.0
Test data
The following JSON request body is used for the load testing:
{name: "nhuLYSlSnpO33PtcfeFaTtTeezj7ukzar3O84sEbvCnnfunoCbhH5IFAZIaaZ3S86SDPVrGEOhm4hjM1H9fHTrdzpaDlyvSI3janVD2HBdmd9sEBsHRmFdqCX7BsV9JRE7uS5o8oNYxKOsafJjwmU4srgpS29P2sS3cKX0WztPIpSoYYRBfsfJu74t36EUZ50eEycJE9coQ0OMNqJWS4hPYbYBpufCXLp92ucOvDCtmqAZovbhOUwWAfRy8COJySpdONrskUpXFl3F5rYfPIl5UDpEoz5aDhEAyntHASw0jbCupfZxbJeM2ExRKFvtC4Ra8Mcmw43QKyhAVVUQeaGPSVOQBGQuuijcrRXGfxpp9UcTcugql07TCEfbREfuZES4XgObdE6rj918exoel3QjShYseS10bPeG2CdoRulyWqY2eSiDQ2qJwi12c02hbA54bxs2tiGy6SxEUgB5ADphfZW6zdaefU6rdAaWOsn3oYiDbFfDVE"}
Code
Here is the HTTPS echo name code in both the runtimes. The Deno code uses async iterators, while the Node code uses callbacks.
Settings
The performance test is executed in following configurations:
- 10 concurrent connections to run a total of 10K requests
- 25 concurrent connections to run a total of 10K requests
- 50 concurrent connections to run a total of 10K requests
Measurements
The following measurements are recorded for each test configuration:
- Time taken
- Requests per second
- Minimum
- 1st Quartile
- Median
- Mean
- 3rd Quartile
- Maximum
- CPU usage
- Memory usage
Results
A total of 10K requests are executed for each test configuration.
For ease of comparison, all the results are summarized graphically. Here are the 14 graphs covering each of the above measurement:
Conclusion
The performance of Deno is slightly slower than Node.js.
Here are the other articles in the performance series: