Branch prediction. With a sorted array, the condition `data[c] >= 128` is first false for a streak of values, then becomes true for all later values. That's easy to predict. With an unsorted array, you pay the branching cost.