-
Notifications
You must be signed in to change notification settings - Fork 657
Benchmarks
Yusuke Inuzuka edited this page Feb 27, 2015
·
9 revisions
Performance measurements in script languages on Go.
Machine: i5-2520M, 8GB, Windows7
prog | time |
---|---|
otto | 0m24.848s |
anko | 0m20.207s |
agora | 0m9.304s |
GopherLua | 0m1.248s |
fib.js
function fib(n) {
if (n < 2) return n;
return fib(n - 2) + fib(n - 1);
}
console.log(fib(30));
$ time otto fib.js
832040
real 0m24.848s
user 0m0.015s
sys 0m0.078s
fib.ank
func fib(n) { if n < 2 { return n } return fib(n - 2) + fib(n - 1) } println(fib(30));
$ time anko fib.ank
832040
real 0m20.207s
user 0m0.030s
sys 0m0.078s
fib.agr
fmt := import("fmt") func fib(n) { if n < 2 { return n } return fib(n-2) + fib(n-1) } fmt.Println(fib(30))
$ time agora run fib.agr
832040
= nil (runtime.null)
real 0m9.304s
user 0m0.000s
sys 0m0.093s
fib.lua
local function fib(n)
if n < 2 then return n end
return fib(n - 2) + fib(n - 1)
end
print(fib(30))
$ time glua fib.lua
832040
real 0m1.248s
user 0m0.015s
sys 0m0.187s