I have following problem: one of the comparison between two floats takes upto 10 times slower then other.
Here is a code (
https://github.com/wildart/kNN.jl/blob/master/src/kdtree.jl#L99-L120). In line 99 and line 120 have the same two floats comparison. When functions runs line 120 is executed more times then line 99, but profiler show strange results
1407 .../v0.3/kNN/src/kdtree.jl nearest 99
161 .../v0.3/kNN/src/kdtree.jl nearest 120
If we look at the generated code, see below, for line 120 intrinsic function called, but for line 99, called wrapper to intrinsic comparison function
Line 99 Line 120 unless #s1169::Bool goto 4 unless #s1162::Bool goto 14
#s1168 = #s1169::Bool #s1161 = #s1162::Bool
goto 5 goto 15
4: 14:
#s1168 = d < T::Float64 #s1161 = top(le_float)(d::Float64,T::Float64)::Bool 5: 15:
unless #s1168 goto 10 # line 100: unless #s1161::Bool goto 17 # line 121:
I attached script that reproduces this problem.