Posted by & filed under Node.js.

This post is making use of the same code from a previous benchmark: Go v1.9.1 vs Node v8.9.0 Microbenchmark. Check that out for some background and code samples if you’d like to try the same experiment. The applications are very simple. There is a global counter which increments with each incoming HTTP request. Both applications reply with the same data format, using simple string concatenation, and no third party libraries.

Here’s the command we’re using to execute the benchmark:

siege -t 2m -b http://localhost:8000/

The results are as follows:

Node v10.6.0

Transactions: 183506 hits
Availability: 100.00 %
Elapsed time: 119.15 secs
Data transferred: 2.52 MB
Response time: 0.01 secs
Transaction rate: 1540.13 trans/sec
Throughput: 0.02 MB/sec
Concurrency: 14.97
Successful transactions: 183506
Failed transactions: 0
Longest transaction: 0.07
Shortest transaction: 0.00

Go v1.10.3

Transactions: 368668 hits
Availability: 100.00 %
Elapsed time: 119.83 secs
Data transferred: 4.81 MB
Response time: 0.00 secs
Transaction rate: 3076.59 trans/sec
Throughput: 0.04 MB/sec
Concurrency: 14.95
Successful transactions: 368668
Failed transactions: 0
Longest transaction: 0.07
Shortest transaction: 0.00

Takeaway

Go is 2.00x as fast as Node.js for this particular benchmark. It’s worth noting that these Node.js results are the same as they were for Node v8. However the Go v1.10 results are about 20% faster than with v1.9.

Thomas Hunter II

Support Thomas on Patreon. Thomas is the author of Advanced Microservices and a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.

Tags: