<p dir="auto">MRE:</p>
<blockquote>
<p dir="auto">julia@1.5.2</p>
</blockquote>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; methods(show);

julia&gt; length(methods(show))
304

julia&gt; @time methods(show);
  0.000278 seconds (966 allocations: 46.531 KiB)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">methods</span>(show);

julia<span class="pl-k">&gt;</span> <span class="pl-c1">length</span>(<span class="pl-c1">methods</span>(show))
<span class="pl-c1">304</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">@time</span> <span class="pl-c1">methods</span>(show);
  <span class="pl-c1">0.000278</span> seconds (<span class="pl-c1">966</span> allocations<span class="pl-k">:</span> <span class="pl-c1">46.531</span> KiB)</pre></div>
<blockquote>
<p dir="auto">julia@master</p>
</blockquote>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; methods(show);

julia&gt; length(methods(show))
314

julia&gt; @time methods(show);
  0.022454 seconds (14.80 k allocations: 812.578 KiB)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">methods</span>(show);

julia<span class="pl-k">&gt;</span> <span class="pl-c1">length</span>(<span class="pl-c1">methods</span>(show))
<span class="pl-c1">314</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">@time</span> <span class="pl-c1">methods</span>(show);
  <span class="pl-c1">0.022454</span> seconds (<span class="pl-c1">14.80</span> k allocations<span class="pl-k">:</span> <span class="pl-c1">812.578</span> KiB)</pre></div>
<p dir="auto">The profiling shows most of the time is spent in <a href="https://github.com/JuliaLang/julia/blob/9d6da9c4d664b832379bd2d0fa97cefecabb0e7e/base/reflection.jl#L808-L817"><code class="notranslate">_methods_by_ftype</code></a>, and I guess <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="622906850" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/35983" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/35983/hovercard" href="https://github.com/JuliaLang/julia/pull/35983">#35983</a> might be the source of this.</p>
<hr>
<p dir="auto">Well, I'm not sure the performance for <code class="notranslate">methods</code> is critical; I found this problem just because Juno's completions are much slower than before when using Julia built from master, and profiling shows that this line calling <code class="notranslate">methods</code> is the source of the performance regression:<br>
<a href="https://github.com/JunoLab/Atom.jl/blob/c751731bd488db815110ed7771b7f313d8b92116/src/utils.jl#L268">https://github.com/JunoLab/Atom.jl/blob/c751731bd488db815110ed7771b7f313d8b92116/src/utils.jl#L268</a></p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ismacro(f::Function) = startswith(string(methods(f).mt.name), &quot;@&quot;)"><pre class="notranslate"><span class="pl-en">ismacro</span>(f<span class="pl-k">::</span><span class="pl-c1">Function</span>) <span class="pl-k">=</span> <span class="pl-c1">startswith</span>(<span class="pl-c1">string</span>(<span class="pl-c1">methods</span>(f)<span class="pl-k">.</span>mt<span class="pl-k">.</span>name), <span class="pl-s"><span class="pl-pds">"</span>@<span class="pl-pds">"</span></span>)</pre></div>
<p dir="auto">Now I found changing this line into</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function ismacro(@nospecialize(f::FT)) where {FT&lt;:Function}
  isdefined(FT, :name) || return false
  tn = FT.name::Core.TypeName
  return occursin('@', string(tn.name))
end"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">ismacro</span>(<span class="pl-c1">@nospecialize</span>(f<span class="pl-k">::</span><span class="pl-c1">FT</span>)) <span class="pl-k">where</span> {FT<span class="pl-k">&lt;:</span><span class="pl-c1">Function</span>}
  <span class="pl-c1">isdefined</span>(FT, <span class="pl-c1">:name</span>) <span class="pl-k">||</span> <span class="pl-k">return</span> <span class="pl-c1">false</span>
  tn <span class="pl-k">=</span> FT<span class="pl-k">.</span>name<span class="pl-k">::</span><span class="pl-c1">Core.TypeName</span>
  <span class="pl-k">return</span> <span class="pl-c1">occursin</span>(<span class="pl-s"><span class="pl-pds">'</span>@<span class="pl-pds">'</span></span>, <span class="pl-c1">string</span>(tn<span class="pl-k">.</span>name))
<span class="pl-k">end</span></pre></div>
<p dir="auto">gets rid of the performance regression anyway, so I'm okay with it if the slowness of <code class="notranslate">methods</code> can't be helped in order to circumvent the latency issues.</p>
<p dir="auto">In version 1.4.2, the following is evaluated pretty much instantly:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; using LinearAlgebra

julia&gt; mul!
mul! (generic function with 154 methods)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">using</span> LinearAlgebra

julia<span class="pl-k">&gt;</span> mul!
mul! (generic <span class="pl-k">function</span> with <span class="pl-c1">154</span> methods)</pre></div>
<p dir="auto">However, in the latest nightly build from commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/JuliaLang/julia/commit/f130d9baa88e353601672c2627b275d02c1f308c/hovercard" href="https://github.com/JuliaLang/julia/commit/f130d9baa88e353601672c2627b275d02c1f308c"><tt>f130d9b</tt></a>, the <code class="notranslate">mul!</code> takes multiple seconds to evaluate.</p>