Spatial Locality of Binary Search
Binary search does not have good spatial locality.
1
4
5
8
9
10
14
15
17
20
25
26
27
29
30
31
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1
4
5
8
9
10
14
15
17
20
25
26
27
29
30
31
1
4
5
8
9
10
14
15
17
20
25
26
27
29
30
31
1
4
5
8
9
10
14
15
17
20
25
26
27
29
30
31
1
4
5
8
9
10
14
15
17
20
25
26
27
29
30
31
4 keys per cache line
Cache line utilization is 1/4 = 25%.
Previous slide
Next slide
Back to first slide
View graphic version