<p dir="auto">This is the benchmark script:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function mysum_int(data)
    sum = 0
    for i in Int(1):Int(endof(data))
        @inbounds sum += data[i]
    end
    return sum
end

function mysum_uint(data)
    sum = 0
    for i in UInt(1):UInt(endof(data))
        @inbounds sum += data[i]
    end
    return sum
end

let
    size = 128 * 2^20
    data = zeros(UInt8, size)
    println(&quot;mysum_int&quot;)
    mysum_int(data)
    @time mysum_int(data)
    @time mysum_int(data)
    @time mysum_int(data)

    println(&quot;mysum_uint&quot;)
    mysum_uint(data)
    @time mysum_uint(data)
    @time mysum_uint(data)
    @time mysum_uint(data)
end"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">mysum_int</span>(data)
    sum <span class="pl-k">=</span> <span class="pl-c1">0</span>
    <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">Int</span>(<span class="pl-c1">1</span>)<span class="pl-k">:</span><span class="pl-c1">Int</span>(<span class="pl-c1">endof</span>(data))
        <span class="pl-c1">@inbounds</span> sum <span class="pl-k">+=</span> data[i]
    <span class="pl-k">end</span>
    <span class="pl-k">return</span> sum
<span class="pl-k">end</span>

<span class="pl-k">function</span> <span class="pl-en">mysum_uint</span>(data)
    sum <span class="pl-k">=</span> <span class="pl-c1">0</span>
    <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">UInt</span>(<span class="pl-c1">1</span>)<span class="pl-k">:</span><span class="pl-c1">UInt</span>(<span class="pl-c1">endof</span>(data))
        <span class="pl-c1">@inbounds</span> sum <span class="pl-k">+=</span> data[i]
    <span class="pl-k">end</span>
    <span class="pl-k">return</span> sum
<span class="pl-k">end</span>

<span class="pl-k">let</span>
    size <span class="pl-k">=</span> <span class="pl-c1">128</span> <span class="pl-k">*</span> <span class="pl-c1">2</span><span class="pl-k">^</span><span class="pl-c1">20</span>
    data <span class="pl-k">=</span> <span class="pl-c1">zeros</span>(UInt8, size)
    <span class="pl-c1">println</span>(<span class="pl-s"><span class="pl-pds">"</span>mysum_int<span class="pl-pds">"</span></span>)
    <span class="pl-c1">mysum_int</span>(data)
    <span class="pl-c1">@time</span> <span class="pl-c1">mysum_int</span>(data)
    <span class="pl-c1">@time</span> <span class="pl-c1">mysum_int</span>(data)
    <span class="pl-c1">@time</span> <span class="pl-c1">mysum_int</span>(data)

    <span class="pl-c1">println</span>(<span class="pl-s"><span class="pl-pds">"</span>mysum_uint<span class="pl-pds">"</span></span>)
    <span class="pl-c1">mysum_uint</span>(data)
    <span class="pl-c1">@time</span> <span class="pl-c1">mysum_uint</span>(data)
    <span class="pl-c1">@time</span> <span class="pl-c1">mysum_uint</span>(data)
    <span class="pl-c1">@time</span> <span class="pl-c1">mysum_uint</span>(data)
<span class="pl-k">end</span></pre></div>
<p dir="auto">And the result:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~/.j/v/BGZFStreams (master|✚1…) $ julia-dev access.jl
mysum_int
  0.022742 seconds (152 allocations: 9.028 KB)
  0.020606 seconds (4 allocations: 160 bytes)
  0.023985 seconds (4 allocations: 160 bytes)
mysum_uint
  0.118161 seconds (4 allocations: 160 bytes)
  0.116512 seconds (4 allocations: 160 bytes)
  0.118702 seconds (4 allocations: 160 bytes)"><pre class="notranslate"><code class="notranslate">~/.j/v/BGZFStreams (master|✚1…) $ julia-dev access.jl
mysum_int
  0.022742 seconds (152 allocations: 9.028 KB)
  0.020606 seconds (4 allocations: 160 bytes)
  0.023985 seconds (4 allocations: 160 bytes)
mysum_uint
  0.118161 seconds (4 allocations: 160 bytes)
  0.116512 seconds (4 allocations: 160 bytes)
  0.118702 seconds (4 allocations: 160 bytes)
</code></pre></div>
<p dir="auto">I don't know the internal, but I guess an index value is converted to <code class="notranslate">Int</code> before accessing and inexact check imposes the cost on it. <code class="notranslate">data[Int(i)]</code> results in the slowdown at the same level but <code class="notranslate">data[reinterpret(Int, i)]</code> doesn't show any slowdown.</p>
<hr>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; versioninfo()
Julia Version 0.5.0-dev+4934
Commit 1a1a9a6* (2016-06-25 02:49 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
"><pre class="notranslate"><code class="notranslate">julia&gt; versioninfo()
Julia Version 0.5.0-dev+4934
Commit 1a1a9a6* (2016-06-25 02:49 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i5-4288U CPU @ 2.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

</code></pre></div>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; @which [2 3] .+ [1 2]
ERROR: UndefVarError: .+ not defined"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">@which</span> [<span class="pl-c1">2</span> <span class="pl-c1">3</span>] <span class="pl-k">.+</span> [<span class="pl-c1">1</span> <span class="pl-c1">2</span>]
ERROR<span class="pl-k">:</span> UndefVarError<span class="pl-k">:</span> <span class="pl-k">.+</span> not defined</pre></div>
<p dir="auto">My intuition is something like <code class="notranslate">a .+ b</code> gets changed to <code class="notranslate">broadcasted_+(a, b)</code>, and was hoping it would return something like<br>
<code class="notranslate">broadcasted_+(a::Array{Int64}...)</code><br>
but now I see it wouldn’t make sense.</p>
<p dir="auto">The error message could be made to say something like<br>
<code class="notranslate">Did you mean '@which broadcast(+, a, b)'?</code></p>