<p dir="auto">Hi everyone,</p>
<p dir="auto">silly "gotcha" installing the latest master from source (on ubuntu 16)- if there is a space in the path you install from, it fails to compile the "compiler simple test", and throws some fairly obscure error messages about cc being an unrecognised compiler.</p>
<p dir="auto">Perhaps just needs a line in the instructions, as it took digging through the compiler logs to find the issue (unless i missed something!).</p>
<p dir="auto">Apologies if duplicated, but couldn't find a relevant issue in a quick search. Happy to contribute fix to docs etc if required.</p>
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">Long pages in the documentation such as the <a href="https://pytorch.org/docs/master/nn.html" rel="nofollow">documentation for the torch.nn module</a> take a long time to render and become interactive. On my system in the page is unresponsive for several seconds while opening this page, which makes navigating around the documentation a bit painful.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Go to the <a href="https://pytorch.org/docs/master/nn.html" rel="nofollow">torch.nn</a> docs page in Chrome, Safari or Firefox</li>
<li>Try to scroll or interact with the page (eg. to go to docs for a specific class from the table of contents) a few seconds after load</li>
</ol>
<p dir="auto">A Chrome trace shows the time is split between layout and scripting. A significant chunk of the scripting time is spent in KaTeX math rendering.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/2458/49345714-ad631a00-f680-11e8-9811-58a0ea0d886b.png"><img width="314" alt="chrome performance summary" src="https://user-images.githubusercontent.com/2458/49345714-ad631a00-f680-11e8-9811-58a0ea0d886b.png" style="max-width: 100%;"></a></p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Ideally the page would be small enough that browsers can load it without becoming unresponsive for a significant amount of time.</p>
<h2 dir="auto">Environment</h2>
<p dir="auto">Tested with Chrome 72 and Safari 12.0 on a late 2016 13" MBP.</p>
<p dir="auto">My knowledge of Sphinx is limited, but perhaps it would make sense to split up the documentation for some of the largest modules into a summary page listing the classes/methods/functions with brief descriptions and a details page with the full docs, eg. using <a href="http://www.sphinx-doc.org/en/master/usage/extensions/autosummary.html" rel="nofollow">sphinx.ext.autosummary</a>?</p>
<p dir="auto">It probably would be possible to optimize the math rendering step without changing the structure, but as long as the page has as many DOM elements as this one, everything is likely to be sluggish.</p>