next.js
b1f80c13 - [turbopack] Avoid calling `find_server_entries` in the whole_app_module_graph case (#81943)

Commit
207 days ago
[turbopack] Avoid calling `find_server_entries` in the whole_app_module_graph case (#81943) ## Improve performance of find_client_references in production builds ### What? Avoid calling `find_server_entries` in the production case where there is a single module graph. While all the turbotasks launched by `find_server_entries` are by definition already done it is still a lot of tiny tasks to get cache hits and re do work that was already done when building the graph. So instead we can just report server components and server utilities when performing the graph traversal. Unfortunately this does not work in development builds since the stacked layout graphs interfere with ordering, so in that case we will still call `find_server_entries`, however we can do this concurrently with the graph traversal to save a bit of latency. ### Why? To improve performance of course! ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/AwJ29EfoPcPdLSwCZxAz/89a13c00-f4a6-4fc1-8626-619ce645600d.png) This represents a small latency progression. Collecting client references is on the critical path for chunking so this makes sense. We have to collect all client references for all pages
Author
Parents
Loading