Deno vs Node.js: Performance comparison: Oak/Express Hello world

The performance comparison is updated for Deno v1.9 and Node v15.14 here: https://mayankchoubey.github.io/Deno-vs-Node-Performance/. The medium doesn’t allow updating posts through API, so this article would be updated later.

This is a series of articles that compare the performance of Deno and Node.js by running various commonly used scenarios. The reliability of Deno is another aspect that will be addressed in another series.

This is part 2 of the performance comparison series. The other parts of the series are:

The first part of the series tests the most basic hello world program. That hello world was using the native/std offered by Deno and Node.js. There are frameworks that can make the task very easy, especially when the application grows. Lots of people use frameworks. Some frameworks are good, efficient while some are inefficient and slow.

In this part of the comparison, the same hello world program gets rewritten using frameworks. Two of the most popular frameworks are used: Oak for Deno, and Express for Node.js.

For this performance testing, a very simple performance tester has been used that runs in Deno. No extra installation required. The performance tester takes all the inputs from the command line and runs the test. It allocates workers that continuously hit the server for the specified number of requests.

Here is the code for both Deno and Node.js:

Deno code is here. Node.js code is here.

Environment: The performance test is executed on MacBook Pro with 8G memory and Quad-core i5 processor. The benchmarker and SUT, both runs on the same machine. There is no network delay.

Versions: Here are the Deno and Node.js versions used for performance comparison.

The performance test is executed for different values of concurrent connections with the same value of repeat. Here are three scenarios:

  • 1 concurrent connection and 1000 repetitions

The following readings were taken: Total time taken, mean, median, min, and max.

TEST RESULTS

Concurrency=1

Here is the overview of the results:

And, here is the detailed distribution (10% quantiles) of the readings:

Here are the graphs:

Concurrency=10

Here is the overview of the results:

And, here is the detailed distribution (10% quantiles) of the readings:

Here are the graphs:

Concurrency=25

Here is the overview of the results:

And, here is the detailed distribution (10% quantiles) of the readings:

Here are the graphs:

Analysis

Deno/oak is consistently faster than Express/Node.js for a simple hello world program. Or, in other words, oak is significantly faster than express.

This story is a part of the exclusive medium publication on Deno: Deno World.

Deno, Node.js, etc.