~amirouche/xp-web-assembly

cb1d3ef8042606fe1b626609db7370624d07fbd1 — Amirouche 4 months ago f009eda
add tail recursive code + benchmarks
3 files changed, 26 insertions(+), 7 deletions(-)

M benchmarks.termgraph.txt
M benchmarks.txt
A test.rec.py
M benchmarks.termgraph.txt => benchmarks.termgraph.txt +8 -6
@@ 1,8 1,10 @@

chez   : ▏ 2.00 
pypy3  : ▏ 14.00
python3: ▏ 76.00
chibi  : ▇▇▇▇ 828.00
nodejs : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 7156.00
jsshell: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 9302.00
chez       : ▏ 2.00 
pypy3      : ▏ 14.00
pypy3/rec  : ▏ 27.00
python3    : ▏ 76.00
python3/rec: ▏ 160.00
chibi      : ▇▇▇▇ 828.00
nodejs     : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 7156.00
jsshell    : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 9302.00


M benchmarks.txt => benchmarks.txt +3 -1
@@ 1,6 1,8 @@
chez 2
pypy3 14
pypy3/rec 27
python3 76
python3/rec 160
chibi 828
nodejs 7156
jsshell 9302
\ No newline at end of file
jsshell 9302

A test.rec.py => test.rec.py +15 -0
@@ 0,0 1,15 @@
from time import perf_counter as time


def fib (a, b, n):
    if (n == 0):
        return a
    else:
        return fib(b, a+b, n-1)

start = time()
for i in range(100000):
    out = fib(0, 1, 16)

print(out)
print(time() - start)