3 ms·
It shouldn't surprise anyone that a checking a bool is faster than calling a function and checking the bool it returns.
by L-four 2y ago
It shouldn't surprise anyone that a checking a bool is faster than calling a function and checking the bool it returns.
- deleted 2y ago[deleted]
- jay-barronville 2y agoThe function call itself isn’t really the culprit (the cost of the function call itself is negligible in this case). It’s the implementation of the function [0]. [0]: https://news.ycombinator.com/item?id=40542102 https://news.ycombinator.com/item?id=40542102