Go v1.15.8 vs Node v14.15.5 Microbenchmark

Looking for a better way to manage your org's technical proposals?
DEPRECATED: This post may no longer be relevant or contain industry best-practices.

This is my fourth annual microbenchmark comparing a very simple Node.js and Go HTTP service running on the local machine. Usual disclaimer: this benchmark is highly contrived and doesn't resemble real-world usage. If you'd like to view the code for the benchmark visit the original benchmark post.

As per usual we run the benchmark using a tool called siege:

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

The results are as follows:

Node v14.15.5

Transactions:                1062379 hits
Availability:                 100.00 %
Elapsed time:                 119.59 secs
Data transferred:              15.15 MB
Response time:                  0.00 secs
Transaction rate:            8883.51 trans/sec <--
Throughput:                     0.13 MB/sec
Concurrency:                   24.49
Successful transactions:     1062379
Failed transactions:               0
Longest transaction:            0.05
Shortest transaction:           0.00

Go v1.15.8

Transactions:                2397471 hits
Availability:                 100.00 %
Elapsed time:                 119.37 secs
Data transferred:              33.24 MB
Response time:                  0.00 secs
Transaction rate:           20084.37 trans/sec <--
Throughput:                     0.28 MB/sec
Concurrency:                   22.86
Successful transactions:     2397473
Failed transactions:               0
Longest transaction:            0.02
Shortest transaction:           0.00

Takeaway

Go is 2.26x as fast as Node.js for this particular benchmark. Node.js is relatively slightly faster this time, as the last time I ran this benchmark Go was 2.69x as fast as Node.js.

Thomas Hunter II Avatar

Thomas Hunter II is a Software Engineer with 18+ years building scalable, production-grade systems. Deep expertise in Node.js, observability, and developer tooling, with a strong track record of driving architectural decisions, mentoring engineers, and improving customer facing technical documentation. Author of 5 books (including O'Reilly), certified by the OpenJS Foundation, and frequent international conference speaker.