Basic C++ Speed (initialization vs adding) and comparison speed
- by seld
I was curious if anyone knows which of the following executes faster (I know this seems like a weird question but I'm trying to shave as much time and resources as possible off my program.)
int i;
i+=1;
or
int i;
i=1;
and I also was curious about which comparison is faster:
//given some integer i
// X is some constant
i < X+1
or
…