Re:Why is it faster to process a sorted array than an unsort...
by manilafolder on Saturday May 18, 2019 @01:15PM
(#19948504)
Hi, for Intel processors, the renamer can detect instructions that will always result in a zero (zero-idioms or dependency breaking idioms). As a result, the renamer will not send the instruction to the execution engine.
Basically, just think of this as repointing your registers to a register that's always zero. Note this only appears for the value zero.
This is one of the reasons you're supposed to wipe out sensitive data with random numbers, not zeros.
Also note that your compiler may copy data to the stack whenever it wants to. So even wiping out data with random numbers may not wipe out the copied data that lives (momentarily) on the stack.
https://webcourse.cs.technion.ac.il/234267/Winter2015-2016/h...
Re:Why is it faster to process a sorted array than an unsort...
by seanmcdirmid on Saturday May 18, 2019 @10:59AM
(#19947757)
The zeroing was somehow priming the cache, maybe it was faster this way because all the zero writes were independent and could easily be run in parallel, whereas normal cache stalls would cause more actual stalling.
Re:Why is it faster to process a sorted array than an unsort...
by gameswithgo on Saturday May 18, 2019 @12:33PM
(#19948286)
prolly a simd enhanced zero operation so very quick.
The non-encrypted transport case had a similar change but there was no measurable performance difference before and after.
I'd like to know what perf stats are available to show what's going on. (I guess it's an L2 cache effect)