On Thu, Sep 8, 2016 at 3:45 PM, Dupont <[email protected]> wrote:

> What is strange to me is that this is much slower
>

Shouldn't be between 2ms and 13s
2s and 13s sounds more reasonable.

A branch in a loop is hard to optimize. LLVM obviously is not doing a very
good job here....


>
>
> function essai(n, s1, s2)
>     a = Vector{Int64}(n)
>
>     @inbounds for k = 1:n
>         ak = 0
>         for ss1 in s1, ss2 in s2
>             if ss1 > ss2
>             ak += 1
>             end
>         end
>         a[k] = ak
>     end
> end
>
>
>

Reply via email to