Just some personal experiments into branch prediction
JavaScript: Performs as expected. Mind, the suggest bitwise improvements don't have as big an effect as they do in C++. I need to do more reading into bitwise operations in general before I can answer why.