Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It shouldn't surprise anyone that a checking a bool is faster than calling a function and checking the bool it returns.


The 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: