Ring benchmark: Erlang vs Go

Ah yes true!

EDIT: And with that fixed (whoops!), the multi-threaded scheduler here I get:

✦ ❯ cargo run --release --bin ring_rs_greenthreads -- -m100 -n100000
   Compiling ring v0.1.0 (/home/overminddl1/tmp/ring)
    Finished release [optimized] target(s) in 16.58s
     Running `target/release/ring_rs_greenthreads -m100 -n100000`
2.823803715s
[src/bin/ring_rs_greenthreads.rs:59] m = 100
[src/bin/ring_rs_greenthreads.rs:59] n = 100000
[src/bin/ring_rs_greenthreads.rs:59] m * n = 10000000

And with the single threaded scheduler I get:

✦ ❯ cargo run --release --bin ring_rs_greenthreads -- -m100 -n100000
   Compiling ring v0.1.0 (/home/overminddl1/tmp/ring)
    Finished release [optimized] target(s) in 16.17s
     Running `target/release/ring_rs_greenthreads -m100 -n100000`
2.278915002s
[src/bin/ring_rs_greenthreads.rs:59] m = 100
[src/bin/ring_rs_greenthreads.rs:59] n = 100000
[src/bin/ring_rs_greenthreads.rs:59] m * n = 10000000

And running the go one again:

❯ ./ring-go -m=100 -n=100000
7.076336311s

And the erlang one again:

2> ring_benchmark:run(100, 100000).
6113590

Five attempts on both the go and erlang ones and took the best results of each.

3 Likes