4 ms·
Indeed, both the algorithm in the article, the rust suggestion, and even the naive solution compile to the same instructions[1]. [1] - https://godbolt.org/z/1P
by baseballdork 5y ago
Indeed, both the algorithm in the article, the rust suggestion, and even the naive solution compile to the same instructions[1].
[1] - https://godbolt.org/z/1P98ss37P https://godbolt.org/z/1P98ss37P
- abainbridge 5y agoThat uses 4 registers and a stack!
- Thiez 5y agoYou can't do better with a non-inlined function.