I was wondering if > is faster then >= ?
I tried to benchmark it but either it takes 0ms or it takes forever.
I understand that the difference will be really small but i have to operate on a lot pixels.
Can someone tell me what is faster?
Answer
Both comparisons will be compiled to machine instructions like BLT
(branch on less than) or BLE
(branch on less equal), which check some status bits like BLT: N-V + -NV
(negative & not overflow or not negative and overflow) or BLE: Z + N-V + -NV
(zero or negative & not overflow or not negative and overflow).
These instruction take normally exactly the same time, so they are equally fast.
No comments:
Post a Comment