Re:BIPLAN looks to be 1370 times faster than Python
by jepler on Sunday February 21, 2021 @09:23AM
(#26213614)
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:
Even this takes only 3.5ms on the "task clock", counting all interpreter start-up time, bytecode compilation, etc:
(oops, that example changed to python2.7; python3.5 is a bit slower at 9ms)
[ Parent
| on HN ]
Re:BIPLAN looks to be 1370 times faster than Python
by Someone on Sunday February 21, 2021 @10:29AM
(#26214125)
Also, give fib(48) a try. Python will switch to bigint, but (https://github.com/gioblu/BIPLAN/blob/master/documentation/n...):
BIPLAN supports only one numeric variable type that is by default int32_t
So, fib(48) will overflow, and probably will return a negative number.
Preferring to give the right answer over giving an answer fast is one of the design decisions Python made.
There also is the unconventional choice to use a global array to store variables, leading to “BIPLAN supports a maximum amount of 116 global variables”. I don’t think changing that to make it growable will affect speed much, though.