updating benchmarks

on the new machine, consistent
not rubyx yet
This commit is contained in:
2019-07-23 20:14:28 +03:00
parent 861fa3203f
commit 00bf38a0e6
17 changed files with 47 additions and 56 deletions

View File

@ -1,36 +1,28 @@
# Benchmarks
loop - program does empty loop of same size as hello
hello - output hello world (to dev/null) to measure kernel calls (not terminal speed)
itos - convert integers from 1 to 100000 to string
add - run integer adds by linear fibonacci of 40
call - exercise calling by recursive fibonacci of 20
hello - output hello world to measure kernel calls
add - run integer adds by linear fibonacci of 20
call - exercise calling by recursive fibonacci of 10
noop - a baseline that does nothing
Hello and puti and add run 100_000 iterations per program invocation to remove startup overhead.
Call only has 10000 iterations, as it much slower
Gcc used to compile c on the machine
typed produced by ruby (on another machine)
All programs (apart from noop) run 1M times to minimize startup impact.
C was linked statically as dynamic linked influences times. Output was sent to /dev/null, so as
to measure the calling and not the terminal.
# Results
Results were measured by a ruby script. Mean and variance was measured until variance was low,
always under one percent.
always under one percent. Noop showed that program startup is a factor, so all programs loop to 1M.
The machine was a virtual arm run on a powerbook, performance roughly equivalent to a raspberry pi.
But results should be seen as relative, not absolute.
The machine was a virtual arm (qemu) run on a acer swift 5 (i5 8265 3.9GHz), performance roughly equivalent to a raspberry pi.
But results (in ms) should be seen as relative, not absolute.
language | loop | hello | itos | add | call
c | 0,0500 | 2,1365 | 0,2902 | 0,1245 | 0,8535
go | 0.0485 | 4.5355 | 0.2143 | 0.0825 | 0.8769
typed | 0,0374 | 1,2071 | 0,7263 | 0,2247 | 1,3625
language | noop | hello | add | call
c | 45 | 100 | 72 | 591
go | 53 | 4060 | 64 | 624
rubyx | 0,0374 | 1,2071 | 0,2247 | 1,3625
ruby | 0,3 | 8.882 | 0,8971 | 3,8452
2c | - 33 % | - 79 % | + 150% | + 80 % | + 60 %
2r | x 10 | x 6 | + 23% | x 17 | x 26
ruby | 1830 | 2750 | 3000 | 1900_000
Comparison with ruby, not really for speed, just to see how much leeway there is for our next layer.
Ruby startup time is 1,5695 seconds, which we'll subtract from the benches