Both compile just as fast.
compiles or run ?
loops are nothing but jmp instructions but in this case for loop with a condition and inc ... B has less job to do but with these operations you will not see much diff in performance but verry little
B has more operations to do. also maybe len in check must be 1024 - 3 and because code don't have any effective purpose so compiler on -O3 makes it nothing
second
The first technically
I think their compilation times are equal. Consider this example: a loop just repeats the code while the condition is still true. So cout << 1; cout << 2; cout << 3; ... as much as you want for (int i = 1; i <= as_much_as_you_want; ++i) cout << i; and for (something like B) { ... } Will give the same result. I think the compiler is smart enough to optimize this.
Обсуждают сегодня