<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Using previous releases of Next.js build time for pages in development mode as been more or less instant (taking at most a second or two to build a page for the first time, with changes being hot reloaded instantly).</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">When using Next.js 5.0 build times for pages in development mode are <em>much</em> slower, often taking several (e.g. 5-10) seconds both for initial page build and for a change to be hot reloaded.</p>
<p dir="auto">I am seeing this same issue across multiple codebases, and someone has raised it as a performance issue against nextjs-starter project, which recently upgraded to 5.0: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="295387737" data-permission-text="Title is private" data-url="https://github.com/iaincollins/nextjs-starter/issues/67" data-hovercard-type="issue" data-hovercard-url="/iaincollins/nextjs-starter/issues/67/hovercard" href="https://github.com/iaincollins/nextjs-starter/issues/67">iaincollins/nextjs-starter#67</a></p>
<h2 dir="auto">Steps to Reproduce</h2>


<ol dir="auto">
<li>Clone example project '<a href="https://github.com/iaincollins/nextjs-starter">https://github.com/iaincollins/nextjs-starter</a>' and start with <code class="notranslate">npm run dev</code>.</li>
<li>Observe performance building pages with Next.js 5.</li>
<li>Stop it and run <code class="notranslate">npm i next@4.2.3 --save</code> and start again with <code class="notranslate">npm run dev</code>.</li>
<li>Observe much better performance building pages.</li>
</ol>
<h2 dir="auto">Context</h2>
<p dir="auto">I don't see this issue on very small sites (4-5 pages, no components) but I see it across all production Next.js sites I run, so it's not just project specific for me.</p>
<p dir="auto">I appreciate it might still be something specific I am doing in those projects, or perhaps just because they all have more components involved.</p>
<p dir="auto">I'm not sure how best to investigate what's causing this (and was a bit uncomfortable raising an issue without a better understanding of how to diagnose it) but as the performance is fine with Next.js 4, it seemed worth raising as an issue as I assume I'm not the only one impacted and if there are things I'm doing that can be avoided to improve performance then it's good to know what they are for others too.</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>5.0</td>
</tr>
<tr>
<td>node</td>
<td>7.10.1</td>
</tr>
<tr>
<td>OS</td>
<td>macOS 10.13.2</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome, Safari</td>
</tr>
</tbody>
</table>
<h1 dir="auto">Feature request</h1>
<h2 dir="auto">Is your feature request related to a problem? Please describe.</h2>
<p dir="auto">I'm currently struggling to find a good way to always keep the scroll height when navigating between 2 pages. It would be great to find a document explaining or an example. The component is being unmounted automatically. Which shouldn't be the case in my opinion?</p>
<h2 dir="auto">Describe the solution you'd like</h2>
<p dir="auto">A. Make sure the component stays alive when navigating from and to component. So the scroll height will be on the same spot.</p>
<h2 dir="auto">Describe alternatives you've considered</h2>
<p dir="auto">On navigation, I'm currently scrolling towards the correct scrollheight, but with inconsistent behaviour.</p>