Comment by lucb1e

Comment by lucb1e 5 days ago

1 reply

I take it this is supposed to be the equivalent of fib(40), which ran on the author's system in Pyπ in 6.59 seconds and apparently on yours, with Raku, in 0.21?

Do you have the same hardware as the author or should one of you run the other's variant to make this directly comparable?

OskarS 5 days ago

No, this is very much not the same. The Raku version is like writing this in Python:

    def fibonacci():
        a, b = 0, 1

        while True:
            yield a
            a, b = b, a+b
And taking the 40th element. It's not comparable at all to the benchmark, that's deliberately an extremely slow method of calculating fibonacci numbers for the purpose of the benchmark. For this version, it's so fast that the time is dominated by the time needed to start up and tear down the interpreter.