var searchId = 5;
var arr = [{ id : 1 },{ id : 7 },{ id : 5 }];
Хороший для тупого перебора случай, ищем 12415
Basic search: average=0ms, min = 0ms, max = 2ms
Binary search: average=0ms, min = 0ms, max = 0ms
Interpolation search: average=0ms, min = 0ms, max = 0ms
Средний для перебора случай, ищем 3451524:
Basic search: average=64ms, min = 62ms, max = 67ms
Binary search: average=0ms, min = 0ms, max = 0ms
Interpolation search: average=0ms, min = 0ms, max = 0ms
Плохой для перебора случай, ищем 9542417:
Basic search: average=176ms, min = 158ms, max = 182ms
Binary search: average=0ms, min = 0ms, max = 0ms
Interpolation search: average=0ms, min = 0ms, max = 0ms