Re:Why is processing a sorted array faster than an unsorted ...
by jamwt on Wednesday October 10, 2012 @05:50PM
(#4638386)
But, in "real programs", all this doesn't usually matter b/c clever JIT tricks with loops and branches fail to offset 5-10x the memory use and the abysmal corresponding CPU cache hit rate.
Re:Why is processing a sorted array faster than an unsorted ...
by pkolaczk on Thursday October 11, 2012 @05:45AM
(#4640147)
5-10x the memory use? Only if coders smoked something. I agree that JITed runtime has some overhead, but in a great majority of cases it is far below what you write here.
See "branch misprediction" vs. "fetch from main memory" on norvig's rough timings list: http://norvig.com/21-days.html#answers .