Skip to content

Commit

Permalink
build based on 4a0c6d1
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 21, 2024
1 parent 25fb14c commit 1702710
Show file tree
Hide file tree
Showing 26 changed files with 165 additions and 160 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-28T00:45:44","documenter_version":"1.5.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-21T11:28:16","documenter_version":"1.7.0"}}
53 changes: 29 additions & 24 deletions dev/assets/documenter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-frappe.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-latte.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-macchiato.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/catppuccin-mocha.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/documenter-dark.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/assets/themes/documenter-light.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/explanations/basic/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/explanations/fixing_inference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
return getfield(d, :maker)::Union{String,Symbol}
end
return getfield(d, name)
end</code></pre><p>Julia&#39;s <a href="https://en.wikipedia.org/wiki/Constant_folding">constant propagation</a> will ensure that most accesses of those fields will be determined at compile-time, so this simple change robustly fixes many inference problems.</p><h2 id="Fixing-Core.Box"><a class="docs-heading-anchor" href="#Fixing-Core.Box">Fixing <code>Core.Box</code></a><a id="Fixing-Core.Box-1"></a><a class="docs-heading-anchor-permalink" href="#Fixing-Core.Box" title="Permalink"></a></h2><p><a href="https://github.com/JuliaLang/julia/issues/15276">Julia issue 15276</a> is one of the more surprising forms of inference failure; it is the most common cause of a <code>Core.Box</code> annotation. If other variables depend on the <code>Box</code>ed variable, then a single <code>Core.Box</code> can lead to widespread inference problems. For this reason, these are also among the first inference problems you should tackle.</p><p>Read <a href="https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-captured">this explanation of why this happens and what you can do to fix it</a>. If you are directed to find <code>Core.Box</code> inference triggers via <a href="../../reference/#SnoopCompile.suggest"><code>suggest</code></a>, you may need to explore around the call site a bit– the inference trigger may be in the closure itself, but the fix needs to go in the method that creates the closure.</p><p>Use of <code>ascend</code> is highly recommended for fixing <code>Core.Box</code> inference failures.</p><h2 id="Handling-edge-cases"><a class="docs-heading-anchor" href="#Handling-edge-cases">Handling edge cases</a><a id="Handling-edge-cases-1"></a><a class="docs-heading-anchor-permalink" href="#Handling-edge-cases" title="Permalink"></a></h2><p>You can sometimes get invalidations from failing to handle &quot;formal&quot; possibilities. For example, operations with regular expressions might return a <code>Union{Nothing, RegexMatch}</code>. You can sometimes get poor type inference by writing code that fails to take account of the possibility that <code>nothing</code> might be returned. For example, a comprehension</p><pre><code class="language-julia hljs">ms = [m.match for m in match.((rex,), my_strings)]</code></pre><p>might be replaced with</p><pre><code class="language-julia hljs">ms = [m.match for m in match.((rex,), my_strings) if m !== nothing]</code></pre><p>and return a better-typed result.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../gotchas/">« Precompilation &quot;gotcha&quot;s</a><a class="docs-footer-nextpage" href="../../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.5.0 on <span class="colophon-date" title="Sunday 28 July 2024 00:45">Sunday 28 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><p>Julia&#39;s <a href="https://en.wikipedia.org/wiki/Constant_folding">constant propagation</a> will ensure that most accesses of those fields will be determined at compile-time, so this simple change robustly fixes many inference problems.</p><h2 id="Fixing-Core.Box"><a class="docs-heading-anchor" href="#Fixing-Core.Box">Fixing <code>Core.Box</code></a><a id="Fixing-Core.Box-1"></a><a class="docs-heading-anchor-permalink" href="#Fixing-Core.Box" title="Permalink"></a></h2><p><a href="https://github.com/JuliaLang/julia/issues/15276">Julia issue 15276</a> is one of the more surprising forms of inference failure; it is the most common cause of a <code>Core.Box</code> annotation. If other variables depend on the <code>Box</code>ed variable, then a single <code>Core.Box</code> can lead to widespread inference problems. For this reason, these are also among the first inference problems you should tackle.</p><p>Read <a href="https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-captured">this explanation of why this happens and what you can do to fix it</a>. If you are directed to find <code>Core.Box</code> inference triggers via <a href="../../reference/#SnoopCompile.suggest"><code>suggest</code></a>, you may need to explore around the call site a bit– the inference trigger may be in the closure itself, but the fix needs to go in the method that creates the closure.</p><p>Use of <code>ascend</code> is highly recommended for fixing <code>Core.Box</code> inference failures.</p><h2 id="Handling-edge-cases"><a class="docs-heading-anchor" href="#Handling-edge-cases">Handling edge cases</a><a id="Handling-edge-cases-1"></a><a class="docs-heading-anchor-permalink" href="#Handling-edge-cases" title="Permalink"></a></h2><p>You can sometimes get invalidations from failing to handle &quot;formal&quot; possibilities. For example, operations with regular expressions might return a <code>Union{Nothing, RegexMatch}</code>. You can sometimes get poor type inference by writing code that fails to take account of the possibility that <code>nothing</code> might be returned. For example, a comprehension</p><pre><code class="language-julia hljs">ms = [m.match for m in match.((rex,), my_strings)]</code></pre><p>might be replaced with</p><pre><code class="language-julia hljs">ms = [m.match for m in match.((rex,), my_strings) if m !== nothing]</code></pre><p>and return a better-typed result.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../gotchas/">« Precompilation &quot;gotcha&quot;s</a><a class="docs-footer-nextpage" href="../../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Saturday 21 September 2024 11:28">Saturday 21 September 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 1702710

Please sign in to comment.