<p dir="auto">I'm not sure if this is an issue or whether there is an expected performance problem with forwarding functions with varargs (or something else). As suggested in a <a href="https://discourse.julialang.org/t/varargs-performance/13578" rel="nofollow">discourse thread</a> I'm submitting it here as an issue.</p>
<p dir="auto">The following code run as a script with <code class="notranslate">-O3</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="using InteractiveUtils

function foo(f::F, m::Int64, args...) where F&lt;:Function
  for i in 1:m
    z = f(args...)
  end
  return true
end

function g(x::Float64, y::Float64)
  return rand() &lt; 0.5, 1
end

function bar(f::F, m::Int64, x::Float64, y::Float64) where F&lt;:Function
  for i in 1:m
    z = f(x, y)
  end
  return true
end

versioninfo()

@btime foo(g, 1000, 1.0, 2.0)
@btime bar(g, 1000, 1.0, 2.0)"><pre lang="using" class="notranslate"><code class="notranslate">using InteractiveUtils

function foo(f::F, m::Int64, args...) where F&lt;:Function
  for i in 1:m
    z = f(args...)
  end
  return true
end

function g(x::Float64, y::Float64)
  return rand() &lt; 0.5, 1
end

function bar(f::F, m::Int64, x::Float64, y::Float64) where F&lt;:Function
  for i in 1:m
    z = f(x, y)
  end
  return true
end

versioninfo()

@btime foo(g, 1000, 1.0, 2.0)
@btime bar(g, 1000, 1.0, 2.0)
</code></pre></div>
<p dir="auto">gives as output</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
Environment:
  JULIA_NUM_THREADS = 4

  38.486 μs (1000 allocations: 31.25 KiB)
  1.260 μs (0 allocations: 0 bytes"><pre class="notranslate"><code class="notranslate">Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, haswell)
Environment:
  JULIA_NUM_THREADS = 4

  38.486 μs (1000 allocations: 31.25 KiB)
  1.260 μs (0 allocations: 0 bytes
</code></pre></div>
<p dir="auto">This suggests there could be an issue with forwarding arguments with varargs.</p>
<p dir="auto">Changing many things in isolation eliminates the allocations, e.g. if</p>
<ol dir="auto">
<li><code class="notranslate">g</code> returns <code class="notranslate">rand() &lt; 0.5</code></li>
<li><code class="notranslate">g</code> returns <code class="notranslate">x &lt; y, 1</code></li>
</ol>
<p dir="auto">As This worked fine when I downloaded and built Julia 1.0 from source.  However, when I download the julia-1.2.0-full.tar.gz file from <a href="https://github.com/JuliaLang/julia/releases/download/v1.2.0/julia-1.2.0-full.tar.gz">https://github.com/JuliaLang/julia/releases/download/v1.2.0/julia-1.2.0-full.tar.gz</a>, I can't get it to build on an isolated network.  Currently the steps I follow are:</p>
<p dir="auto">% tar -xvf julia-1.2.0-full.tar.gz<br>
% make<br>
Warning: git information unavailable; versioning information limited<br>
Warning: git information unavailable; versioning information limited<br>
Warning: git information unavailable; versioning information limited<br>
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>
Dload  Upload   Total   Spent    Left  Speed<br>
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed connect to cache.julialang.org:443; Connection refused<br>
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>
Dload  Upload   Total   Spent    Left  Speed<br>
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed connect to github.com:443; Connection refused<br>
make[1]: *** [/home/user1/julia-1.2.0/deps/srccache/SuiteSparse.v5.4.0-2.x86_64-linux-gnu-gcc4.tar.gz] Error 7<br>
make: *** [julia-deps] Error 2</p>
<p dir="auto">OS:  RHEL 7.6 fully patched.</p>
<p dir="auto">Any help would be greatly appreciated.</p>