Hacker News new | ask | show | jobs
by mbel 3378 days ago
Yeah, it's hardly a benchmark. The information what kind of CPU they are using is also missing (why no -march=native?).

Despite how unbelievable it looks, I would love to see contents of the final binary to see what is really happening there. gcc code looks quite alright in this case: https://godbolt.org/g/R6iBup

1 comments

My totally unsupported guess is that they detect pure functions and add implicit memoization. It is relative easy to implement, has good benchmark times if N is big enough but not too big to make the trick obvious, but under the hood it use more memory than you expected.