5 ms·
That's not what I was saying. I was indicating that more memory accesses would be required in unsorted data for the `sum += data[c]` computation, obviously over
by prophetjohn 14y ago
That's not what I was saying. I was indicating that more memory accesses would be required in unsorted data for the `sum += data[c]` computation, obviously overlooking that data[c] is already in a cache, and probably in a register as a result of the comparison with 128.
- tptacek 14y agoYes, the value is in a register.
- drv 14y agoBut 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.
- tptacek 14y agoThe counter also doesn't need cache; it gets assigned a register.
- prophetjohn 14y agoI know. Let me state it another way. "I was wrong, but not in the way that you(tptacek) understood me to be."
- tptacek 14y agoFor 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.