Preventing compiler optimizations while benchmarking
tl;dr doNotOptimizeAway creates an artificial “use”s. A little bit of terminology here: a “def” (“definition”) is a statement, which assigns a value to a variable; a “use” is a statement, which uses the value of a variable to perform some operation. If from the point immediately after a def, all the paths to the program … Read more