A couple of informal tests

I have an application where I wanted to shoot for low latency, largely concurrent calls to a REST API. Much of the work I’ve been doing for the last few years has been using nodejs and thus javascript. Most of this code has been (thankfully) implemented in as “modern” a version of the ECMAScript spec that I can manage (thanks Babel!) which has helped with my productivity and enthusiasm. Instead of firing yarn to init a new project I decided to take a step back and do some fun little (informal) sandbox testing with another language, specifically golang. I was curious, which would be faster at fetching the Google landing page? A friend of mine was curious about Dart performance as well, so I included that and a *nix cli script that calls cURL.

Note, none of this is necessarily idiomatic for each language, or even representative of best practices…but it does represent the results of a “how far can I get in less than 2min of googling…” style research ;)

Dart: ~250ms

Golang: ~80ms (~70ms when compiled)

Node: ~260ms

cURL: ~100ms

Again, none of this was a controlled, scientific study of performance. Each test was run a few times and a rough median was drummed up.

Node and Dart seemed to have similar latencies, with golang being quite speedy comparably.