Going loopy
xania.org·7h
🔄SIMD Programming
Preview
Report Post

Written by me, proof-read by an LLM. Details at end.

Which loop style is “best”? This very question led to the creation of Compiler Explorer! In 2011 I was arguing with my team about whether we could switch all our loops from ordinal or iterator-style to the “new” range-for1. I wrote a small shell script to iteratively show the compiler output as I edited code in vim, and the seed of Compiler Explorer was born.

C and C++ have many ways to phrase loops: for(), while(), do..while(), range-for (for (x : container)), STL algorithms like std::for_each, and now range transformations! Let’s see if loop style actually matters for performance.

Let’s look at similar functions that…

Similar Posts

Loading similar posts...