ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.06k stars 437 forks source link

Curious question about ranges and branch prediction #1687

Open johannes-graeter opened 2 years ago

johannes-graeter commented 2 years ago

Hi Range-v3-Team,

thx for this amazing library and bringing c++ to the next level. I was discussing with a collegue wether or not using ranges helps the branch predictor. So is it better for branch prediction to use f.e. filter over a branchy for-loop (like here https://godbolt.org/z/Tbe7eoGPx ) What is your take on that?

Best