redid the old benchmarks
With #26 out of the way, was able to get meaningful rubyx benchmarks. Meaning loops large enough for the exec time to go significantly over the noop. Did mruby too and as expected got much lower noop
This commit is contained in:
parent
ab87806d08
commit
6273ab769c
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
setbuf(stdout, NULL); /* to make it equivalent to the other versions, otherwise it caches */
|
||||||
int counter = 100000;
|
int counter = 100000;
|
||||||
while(counter--) {
|
while(counter--) {
|
||||||
printf("Hello there\n");
|
printf("Hello there\n");
|
||||||
|
@ -7,8 +7,10 @@ noop - a baseline that does nothing
|
|||||||
|
|
||||||
All programs (apart from noop) run 100k times to minimize startup impact.
|
All programs (apart from noop) run 100k times to minimize startup impact.
|
||||||
|
|
||||||
C was linked statically as dynamic linked influences times. Output was sent to /dev/null, so as
|
C was linked statically as dynamic linked influences times.
|
||||||
to measure the calling and not the terminal.
|
Output was sent to /dev/null, so as to measure the calling and not the terminal.
|
||||||
|
Also output was unbuffered, because that is what rubyx implements.
|
||||||
|
|
||||||
# Results
|
# Results
|
||||||
|
|
||||||
Results were measured by a ruby script. Mean and variance was measured until variance was low,
|
Results were measured by a ruby script. Mean and variance was measured until variance was low,
|
||||||
@ -16,14 +18,12 @@ always under one percent. Noop showed that program startup is a factor, so all p
|
|||||||
to 100k.
|
to 100k.
|
||||||
|
|
||||||
The machine was a virtual arm (qemu) run on a acer swift 5 (i5 8265 3.9GHz), performance roughly equivalent to a raspberry pi.
|
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.
|
Results (in ms) should be seen as relative, not absolute.
|
||||||
|
|
||||||
|
|
||||||
language | noop | hello | add | call
|
language | noop | hello | add | call
|
||||||
c | 45 | 100 | 72 | 591
|
c | 45 | 3480 | 72 | 591
|
||||||
go | 53 | 4060 | 64 | 624
|
go | 53 | 4000 | 64 | 624
|
||||||
rubyx | 42 | 1245 | ????? | ????
|
rubyx | 47 | 1660 | 800 | 2000
|
||||||
|
ruby | 1570 | 8240 | 2700 | 12370
|
||||||
ruby | 1830 | 2750 | 3000 | 1900_000
|
mruby | 108 | 11210 | 1580 | 23400
|
||||||
|
|
||||||
Comparison with ruby, not really for speed, just to see how much leeway there is in the future.
|
|
||||||
|
@ -8,7 +8,7 @@ def fibo_r( n )
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
counter = 100
|
counter = 10000
|
||||||
|
|
||||||
while(counter > 0) do
|
while(counter > 0) do
|
||||||
fibo_r(10)
|
fibo_r(10)
|
||||||
|
@ -2,5 +2,7 @@
|
|||||||
counter = 100000;
|
counter = 100000;
|
||||||
while(counter > 0) do
|
while(counter > 0) do
|
||||||
puts "Hello there"
|
puts "Hello there"
|
||||||
|
# roughly 4 times slower with this, which is like rubyx
|
||||||
|
#STDOUT.flush
|
||||||
counter = counter - 1
|
counter = counter - 1
|
||||||
end
|
end
|
||||||
|
23
test/bench/rubyx/adds.rb
Normal file
23
test/bench/rubyx/adds.rb
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
class Space
|
||||||
|
|
||||||
|
def fibo_i(fib)
|
||||||
|
a = 0
|
||||||
|
b = fib
|
||||||
|
while( a < b )
|
||||||
|
a = a + 1
|
||||||
|
b = b - 1
|
||||||
|
end
|
||||||
|
return a
|
||||||
|
end
|
||||||
|
|
||||||
|
# ran with --parfait=100000
|
||||||
|
# (time - noop) * 25 + noop
|
||||||
|
def main(arg)
|
||||||
|
b = 4000
|
||||||
|
while( b >= 1 )
|
||||||
|
b = b - 1
|
||||||
|
fibo_i(20)
|
||||||
|
end
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
end
|
27
test/bench/rubyx/calls.rb
Normal file
27
test/bench/rubyx/calls.rb
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
class Space
|
||||||
|
|
||||||
|
def fibo_r(fib)
|
||||||
|
n = fib
|
||||||
|
a = 0
|
||||||
|
b = 1
|
||||||
|
i = 1
|
||||||
|
while( i < n )
|
||||||
|
result = a + b
|
||||||
|
a = b
|
||||||
|
b = result
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
# ran with --parfait=80000
|
||||||
|
# (time - noop) * 50 + noop
|
||||||
|
def main(arg)
|
||||||
|
b = 2000
|
||||||
|
while( b >= 1 )
|
||||||
|
b = b - 1
|
||||||
|
fibo_r(20)
|
||||||
|
end
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
end
|
@ -1,6 +1,8 @@
|
|||||||
class Space
|
class Space
|
||||||
|
# ran with --parfait=25000
|
||||||
|
# time - noop * 10 + noop
|
||||||
def main(arg)
|
def main(arg)
|
||||||
b = 2*1000
|
b = 10000
|
||||||
while( b >= 1 )
|
while( b >= 1 )
|
||||||
b = b - 1
|
b = b - 1
|
||||||
"Hello-there\n".putstring
|
"Hello-there\n".putstring
|
||||||
|
Loading…
Reference in New Issue
Block a user