Ah, your bool version is so much faster because it only initializes the array once, not once per repetition. Your mytest loop only calls init_flags the last time. I feel much better.