Dart vs Go performance (http)

Dart vs Go
Dartlang vs Golang
HTTP performance

A simple test

server.dart

main.go

Dart v2.5.2
Go v1.13.1

OS: Linux
Test runner: wrk
Threads: 4
Duration: 30 seconds
Concurrency: 1000

Results:

I wrote this blog post because I could not find a proper result for “Dart vs Go performance”.
So there you have it

I believe it’s a pretty large score 1:0 for Go on the server side in terms of performance.

Updated on 26 July 2020:

Dart VM version: 2.8.4 (stable) (Wed Jun 3 12:26:04 2020 +0200) on “linux_x64”
go version go1.14.5 linux/amd64

changed Go code to utilize only 1 cpu

Still a pretty big 1:0 for Go

Note: The 2 tests were done one 2 different machines.

Spread the love

4 Replies to “Dart vs Go performance (http)”

  1. I think this is an unfair comparison because the go code is multi-threaded but the dart code isn’t, as the HTTP server is a very basic implementation.

    I found a framework that is supposed to be multi-threaded (https://aqueduct.io/) and did a simple test with it and it is a bit better (my results with the same test as in here were ~200k req/s for go and ~10k req/s for the implementation here, and ~35k req/s for aqueduct with 4 threads too). Another catch is dart can be compiled to native code or run a VM, but not all packages work compiled as native code, and this aqueduct framework uses one of them so I had to do the test in the VM.

    Because of this I tried (very hard) to do a simple implementation using a pool of Isolates (threads) with plain dart but failed, mainly because isolate can only communicate via messages that can only be of primitive types (int, String, etc.), so I can’t really reply to requests in other threads.

    I was really interested in knowing how dart performance compares to go, and this was an interesting example. It’s a bit sad to realize that dart isn’t even capable to offer a multi-threading flexible enough to implement a decent web server…

Leave a Reply

Your email address will not be published. Required fields are marked *