BIPLAN: https://github.com/gioblu/BIPLAN
is a programming language, which comes with its own virtual machine and its compiler. It is really simple and it is an early protototype, although benchmarking it looks astonishingly quicker than other interpreted programming languages like python. How can be 3 orders of magnitude quicker than python? O_O
It seems likely you're measuring something other than what you intended to measure, like the start-up time of the Python interpreter, time to byte-compile Python source, etc. fib(40) itself runs in 1.1us/loop on this Ryzen 3700X running Debian Buster and Python 3.7.3, excluding start-up costs using timeit:
python3 -mtimeit -s"
def fib(x):
a = 0
b = 1
for i in range(x):
a, b = a+b, a
return a
assert fib(40) == 102334155
" "fib(40)"
Even this takes only 3.5ms on the "task clock", counting all interpreter start-up time, bytecode compilation, etc:
perf stat python -S -c "
def fib(x):
a = 0
b = 1
for i in range(x):
a, b = a+b, a
return a
assert fib(40) == 102334155
"
(oops, that example changed to python2.7; python3.5 is a bit slower at 9ms)
Well, Python is not known for its speed (even among established interpreted languages), and a couple of design choices make it have a pretty heavy overhead.
Still, a toy language focusing on a particular benchmark can most likely easily beat any other high-level language.
[+] [-] gioscarab|5 years ago|reply
[+] [-] jepler|5 years ago|reply
[+] [-] necovek|5 years ago|reply
Still, a toy language focusing on a particular benchmark can most likely easily beat any other high-level language.