3 ms·
Yeah, but unlike the hack in the article, the more readable version of that code, "Thing 1" if some_boolean else "Thing 2" is also almost twice as fast(775
by icebraining 13y ago
Yeah, but unlike the hack in the article, the more readable version of that code,
"Thing 1" if some_boolean else "Thing 2"
is also almost twice as fast(775 vs 1340 ns, on my machine).
- StavrosK 13y agoI was more posting it for the "cute hack" value, rather than speed. Speed was significant in the post because the author needed their library to be fast.