Maybe my array is too small to see a difference, but if I increase the size 
I will lack of RAM ;)

julia> x = 1:0.1:1000000
1.0:0.1:1.0e6

julia> @time searchsorted(x, 8.22)
  0.045590 seconds (33.21 k allocations: 1.535 MB)
74:73

julia> @time searchsorted(x, 8.22)
  0.000005 seconds (8 allocations: 288 bytes)
74:73

julia> @time searchsorted(x, 8.22)
  0.000005 seconds (8 allocations: 288 bytes)
74:73

julia> @time closest_index(x,8.22)
  0.103219 seconds (4.37 k allocations: 222.884 KB)
73

julia> @time closest_index(x,8.22)
  0.095684 seconds (4 allocations: 160 bytes)
73

julia> @time dicotomy(x, 8.22)
  0.009142 seconds (3.45 k allocations: 173.973 KB)
(73,74)

julia> @time dicotomy(x, 8.22)
  0.000005 seconds (5 allocations: 192 bytes)
(73,74)

julia> @time dicotomy(x, 8.22)
  0.000004 seconds (5 allocations: 192 bytes)
(73,74)



Even better: get rid of the brackets around 1:0.1:100000, and you'll be 
> that 
> much more impressed. 
>
> --Tim 
>
>

Reply via email to