Skip to content

Comment on Why is processing a sorted array faster than an unsorted array?parent

Comments

But that is true whether the array is sorted or not; the indexes (and therefore memory accesses) in the loop are still in order even if the contents of the array are not sorted.

The counter also doesn't need cache; it gets assigned a register.

I know. Let me state it another way.

"I was wrong, but not in the way that you(tptacek) understood me to be."

For the record: I acknowledge that you were not wrong in the way I understood you to be wrong; I responded because I got the sense that the thread was now discussing the storage of boolean expression results, and klaxons inside my nerd brain started going off.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.