-
Couldn't load subscription status.
- Fork 689
Benchmarks
Yusuke Inuzuka edited this page Aug 20, 2016
·
9 revisions
Machine: Windows7 64bit CPU:2, Memory:8GB
Go version: 1.7
Script languages implemented in pure Go
Other script languages
- lua5.1.4
- Python3.4
| prog | time |
|---|---|
| anko | 182.73s |
| otto | 173.32s |
| go-lua | 8.13s |
| Python3.4 | 5.84s |
| GopherLua | 5.40s |
| lua5.1.4 | 1.71s |
fib.js
function fib(n) {
if (n < 2) return n;
return fib(n - 2) + fib(n - 1);
}
console.log(fib(35));% time otto fib.js
9227465
otto fib.js 0.01s user 0.00s system 0% cpu 2:53.32 totalfib.ank
func fib(n) {
if n < 2 {
return n
}
return fib(n - 2) + fib(n - 1)
}
println(fib(35));
% time anko fib.ank
9227465
anko fib.ank 0.00s user 0.23s system 0% cpu 3:02.73 totalfib.lua
local function fib(n)
if n < 2 then return n end
return fib(n - 2) + fib(n - 1)
end
print(fib(35))% time go-lua fib.lua
9227465
go-lua fib.lua 0.00s user 0.08s system 0% cpu 8.129 total
% time glua fib.lua
9227465
glua fib.lua 0.01s user 0.00s system 0% cpu 5.403 total
% lua -v
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
% time lua fib.lua
9227465
lua fib.lua 0.00s user 0.00s system 0% cpu 1.714 totalfib.py
def fib(n)
if n < 2:
return n
return fib(n - 2) + fib(n - 1)
print(fib(35))% python34 --version
Python 3.4.3
% time python34 fib.py
9227465
python34 fib.py 0.00s user 0.07s system 1% cpu 5.846 total