fixing test to pass
and extract own kind of same tests to bench bench tests will need some loop, but not as large as c
This commit is contained in:
parent
14c965360d
commit
95af84e752
@ -5,14 +5,15 @@ add - run integer adds by linear fibonacci of 20
|
|||||||
call - exercise calling by recursive fibonacci of 10
|
call - exercise calling by recursive fibonacci of 10
|
||||||
noop - a baseline that does nothing
|
noop - a baseline that does nothing
|
||||||
|
|
||||||
All programs (apart from noop) run 1M 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. Output was sent to /dev/null, so as
|
||||||
to measure the calling and not the terminal.
|
to measure the calling and not the terminal.
|
||||||
# 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,
|
||||||
always under one percent. Noop showed that program startup is a factor, so all programs loop to 1M.
|
always under one percent. Noop showed that program startup is a factor, so all programs loop
|
||||||
|
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.
|
But results (in ms) should be seen as relative, not absolute.
|
||||||
@ -21,8 +22,8 @@ But 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 | 100 | 72 | 591
|
||||||
go | 53 | 4060 | 64 | 624
|
go | 53 | 4060 | 64 | 624
|
||||||
rubyx | 0,0374 | 1,2071 | 0,2247 | 1,3625
|
rubyx | 42 | 1245 | ????? | ????
|
||||||
|
|
||||||
ruby | 1830 | 2750 | 3000 | 1900_000
|
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.
|
Comparison with ruby, not really for speed, just to see how much leeway there is in the future.
|
||||||
|
10
test/bench/rubyx/hello.rb
Normal file
10
test/bench/rubyx/hello.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class Space
|
||||||
|
def main(arg)
|
||||||
|
b = 2*1000
|
||||||
|
while( b >= 1 )
|
||||||
|
b = b - 1
|
||||||
|
"Hello-there\n".putstring
|
||||||
|
end
|
||||||
|
return b
|
||||||
|
end
|
||||||
|
end
|
5
test/bench/rubyx/noop.rb
Normal file
5
test/bench/rubyx/noop.rb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class Space
|
||||||
|
def main(arg)
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
@ -1,6 +1,6 @@
|
|||||||
class Space
|
class Space
|
||||||
def main(arg)
|
def main(arg)
|
||||||
n = 10
|
n = 6
|
||||||
a = 0
|
a = 0
|
||||||
b = 1
|
b = 1
|
||||||
i = 1
|
i = 1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
class Space
|
class Space
|
||||||
def main(arg)
|
def main(arg)
|
||||||
return "Hello-there\n".putstring
|
return "Hello-there".putstring
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -11,6 +11,6 @@ class Space
|
|||||||
end
|
end
|
||||||
|
|
||||||
def main(arg)
|
def main(arg)
|
||||||
return fibo_r(10)
|
return fibo_r(5)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user