News for hackers. Stuff that matters.
Re:Emacs-ng: Emacs with Deno runtime and TypeScript by taeric on Tuesday March 16, 2021 @07:55PM (#26484822)
Right. I "know" how tree recursion scales up. It is still neat to "see" the impact on the speed.

That is, knowing all of these facts, it is still impressive how fast you can get (fib 1000000) using iteration and bignums.

Re:Emacs-ng: Emacs with Deno runtime and TypeScript by vitus on Tuesday March 16, 2021 @09:14PM (#26485377)
There, that runtime is roughly O(n^2) when dealing with bignums, since addition scales linearly with bit length of the operands, and bit length increases linearly with the number of iterations (~0.7 bits per iteration).

Which is still not fast -- on my laptop, Python takes about 9s for fib(1000000). But compared to an exponentially-growing function, that's a blink of an eye.