Discussion about this post

User's avatar
Yacob Cohen-Arazi's avatar

it's funny. Initially I was skimming fast and thought you'll be using an array for the loop. I did not realize that it was a vector. Interesting finds though. There is a limit where the compile/optimizer(?) would say - I'm not doing this nice optimization anymore and falling back to regular allocation.

So in the last snippet, gcc is using jne. Is this worse? in terms of the cpu branch predictor?

Expand full comment
1 more comment...

No posts