If the ready list usually contains only a few tasks but occasionally contains more, then the list should be sorted by priority, so that finding the highest priority task to run does not require iterating through the entire list.
Then the list should be sorted by priority, so that finding the highest priority task to run does not require iterating through the entire list. The ready list usually contains only a few tasks. The ready list occasionally contains more.