<p dir="auto">Starting in julia 1.4, the <code class="notranslate">Warning</code> <strong>disappeared</strong> from <code class="notranslate">Profile</code> when you've overrun the profile buffer:</p>
<p dir="auto">On 1.3:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; using Profile

julia&gt; Profile.init(n=10, delay=0.000001)  # Definitely going to run out of buffer

julia&gt; @profile for _ in 1:10 peakflops() end

julia&gt; Profile.print()
┌ Warning: The profile data buffer is full; profiling probably terminated
│ before your program finished. To profile for longer runs, call
│ `Profile.init()` with a larger buffer and/or larger delay.
└ @ Profile /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Profile/src/Profile.jl:312
┌ Warning: There were no samples collected. Run your program longer (perhaps by
│ running it multiple times), or adjust the delay between samples with
│ `Profile.init()`.
└ @ Profile /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Profile/src/Profile.jl:667"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">using</span> Profile

julia<span class="pl-k">&gt;</span> Profile<span class="pl-k">.</span><span class="pl-c1">init</span>(n<span class="pl-k">=</span><span class="pl-c1">10</span>, delay<span class="pl-k">=</span><span class="pl-c1">0.000001</span>)  <span class="pl-c"><span class="pl-c">#</span> Definitely going to run out of buffer</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">@profile</span> <span class="pl-k">for</span> _ <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">10</span> <span class="pl-c1">peakflops</span>() <span class="pl-k">end</span>

julia<span class="pl-k">&gt;</span> Profile<span class="pl-k">.</span><span class="pl-c1">print</span>()
┌ Warning<span class="pl-k">:</span> The profile data buffer is full; profiling probably terminated
│ before your program finished. To profile <span class="pl-k">for</span> longer runs, call
│ <span class="pl-s"><span class="pl-pds">`</span>Profile.init()<span class="pl-pds">`</span></span> with a larger buffer and<span class="pl-k">/</span>or larger delay.
└ @ Profile <span class="pl-k">/</span>Users<span class="pl-k">/</span>julia<span class="pl-k">/</span>buildbot<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_macos64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Profile<span class="pl-k">/</span>src<span class="pl-k">/</span>Profile<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">312</span>
┌ Warning<span class="pl-k">:</span> There were no samples collected. Run your program longer (perhaps by
│ running it multiple times), or adjust the delay between samples with
│ <span class="pl-s"><span class="pl-pds">`</span>Profile.init()<span class="pl-pds">`</span></span>.
└ @ Profile <span class="pl-k">/</span>Users<span class="pl-k">/</span>julia<span class="pl-k">/</span>buildbot<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_macos64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">3</span><span class="pl-k">/</span>Profile<span class="pl-k">/</span>src<span class="pl-k">/</span>Profile<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">667</span></pre></div>
<p dir="auto">On 1.4:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; using Profile

julia&gt; Profile.init(n=10, delay=0.000001)  # Definitely going to run out of buffer

julia&gt; @profile for _ in 1:10 peakflops() end

julia&gt; Profile.print()
┌ Warning: There were no samples collected. Run your program longer (perhaps by
│ running it multiple times), or adjust the delay between samples with
│ `Profile.init()`.
└ @ Profile /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Profile/src/Profile.jl:851"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">using</span> Profile

julia<span class="pl-k">&gt;</span> Profile<span class="pl-k">.</span><span class="pl-c1">init</span>(n<span class="pl-k">=</span><span class="pl-c1">10</span>, delay<span class="pl-k">=</span><span class="pl-c1">0.000001</span>)  <span class="pl-c"><span class="pl-c">#</span> Definitely going to run out of buffer</span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">@profile</span> <span class="pl-k">for</span> _ <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">10</span> <span class="pl-c1">peakflops</span>() <span class="pl-k">end</span>

julia<span class="pl-k">&gt;</span> Profile<span class="pl-k">.</span><span class="pl-c1">print</span>()
┌ Warning<span class="pl-k">:</span> There were no samples collected. Run your program longer (perhaps by
│ running it multiple times), or adjust the delay between samples with
│ <span class="pl-s"><span class="pl-pds">`</span>Profile.init()<span class="pl-pds">`</span></span>.
└ @ Profile <span class="pl-k">/</span>Users<span class="pl-k">/</span>julia<span class="pl-k">/</span>buildbot<span class="pl-k">/</span>worker<span class="pl-k">/</span>package_macos64<span class="pl-k">/</span>build<span class="pl-k">/</span>usr<span class="pl-k">/</span>share<span class="pl-k">/</span>julia<span class="pl-k">/</span>stdlib<span class="pl-k">/</span>v1.<span class="pl-c1">4</span><span class="pl-k">/</span>Profile<span class="pl-k">/</span>src<span class="pl-k">/</span>Profile<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">851</span></pre></div>
<p dir="auto">Obviously the above is a silly example, but this has definitely led to some wasted time in practice trying to understand a profile that doesn't make sense, only to eventually realize that the buffer must not have been big enough!</p>
<p dir="auto">Can we add this Warning back to the package? It is <strong>very useful</strong> and should be cheap to perform.</p>
<hr>
<p dir="auto"><em>Even better,</em> can we <em>also</em> add a runtime check to print such a Warning as soon as the buffer fills up, <em>during profiling</em>? This way  we can know to kill our profiling process and adjust the buffer, and re-run, shortening the developer loop.</p>
<hr>
<p dir="auto">I've been meaning to file an issue about this for a long time. I'm sorry it took me so long to do! :) Thanks for all your hard work and these very useful tools! ❤️ !</p>
<p dir="auto">The Regex docs provide indexing with Symbol, where the symbol is the name of the capture group.</p>
<p dir="auto">What is lacking is a way to retrieve the capture group names from either a Match or just the Regex itself (from the docs).</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="s = &quot;aaa bbb ccc&quot;
r = r&quot;(?&lt;a&gt;.*) (?&lt;b&gt;.*) (?&lt;c&gt;.*)&quot;
m = match(r, s) # I don't think there is a way to retrieve the symbols [:a, :b, :c] from this or `r`"><pre class="notranslate">s <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>aaa bbb ccc<span class="pl-pds">"</span></span>
r <span class="pl-k">=</span> <span class="pl-sr"><span class="pl-pds">r"</span>(?&lt;a&gt;.*) (?&lt;b&gt;.*) (?&lt;c&gt;.*)<span class="pl-pds">"</span></span>
m <span class="pl-k">=</span> <span class="pl-c1">match</span>(r, s) <span class="pl-c"><span class="pl-c">#</span> I don't think there is a way to retrieve the symbols [:a, :b, :c] from this or `r`</span></pre></div>
<p dir="auto">One has to know about <code class="notranslate">Base.PCRE.capture_names(m.regex.regex)</code>.</p>
<p dir="auto">The context in which this arose was wanting to easily construct a <code class="notranslate">DataFrame</code> from a <code class="notranslate">Vector{RegexMatch}</code> where the capture group names become the column names. Thanks to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pdeffebach/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pdeffebach">@pdeffebach</a> for finding the <code class="notranslate">capture_names</code> function for me.</p>
<p dir="auto">This should be a simple PR to add a line to <a href="https://docs.julialang.org/en/v1/manual/strings/#Regular-Expressions" rel="nofollow">https://docs.julialang.org/en/v1/manual/strings/#Regular-Expressions</a> mentioning it.</p>
<p dir="auto">I may get to it, I may not xd</p>