But then I'm not running the same code as either the parent of my comment, or the article, and the benchmark doesn't hold. It's how fast can my CPU run the same code vs theres. I could make it faster again by precomputing a table and doing a lookup but that defies the point!
I started at 10.853, and with very little effort brought it down to 0.003
The slowdown isn't in assigning the bool; If you pass in 10000000 into that function, it's going to get isPrime set to true on the first iteration, but if you early out, you save all of those values. Again, this isn't really the point of the exercise, it's supposed to be comparing the performance of the same piece of code ran on different hardware.