What is faster (x < 0) or (x == -1)?
That depends entirely on the ISA you’re compiling for, and the quality of your compiler’s optimizer. Don’t optimize prematurely: profile first to find your bottlenecks. That said, in x86, you’ll find that both are equally fast in most cases. In both cases, you’ll have a comparison (cmp) and a conditional jump (jCC) instructions. However, for …