News for hackers. Stuff that matters.
Re:Why is it faster to process a sorted array than an unsort... by winstonewert on Friday September 15, 2017 @11:02AM (#15257690)
guess: the branches in the python VM are more accurately predicted than branch on the data. The data is going to be random and thus unpredictable, but the branches in the VM are probably pretty predictable.
Re:Why is it faster to process a sorted array than an unsort... by dom0 on Friday September 15, 2017 @11:07AM (#15257737)
Python if statements will branch on very few processor instructions in the VM; so I don't think branch prediction of the processor is able to predict different Python if's — they're all the same to it.

Well, that... and even simple Python VM instructions tend to take dozens of insns to execute.