next.js
2c0ea98d - Turbopack: don't block on parsing traced modules (#82602)

Commit
139 days ago
Turbopack: don't block on parsing traced modules (#82602) We were (unnecessarily) calling `is_self_async()` even for the traced externals (the directly referenced ones, not transitively). This created a bottleneck during the global information computation: <img width="2560" height="1315" alt="Bildschirmfoto 2025-08-13 um 09 50 19" src="https://github.com/user-attachments/assets/4f5d1fa6-3d65-40b2-875e-8a4a579b234b" /> `compute_async_module_info_single` calls `is_self_async` for every single module, regardless of whether the computed value is actually used or not (the traced modules have `ChunkingType::Traced`, so they'd never cause any importers to be async anyway). So manually optimize this case by overriding `is_self_async` for traced externals. This defers the parsing to emitting which is much more parallel: <img width="2560" height="1315" alt="Bildschirmfoto 2025-08-13 um 09 51 23" src="https://github.com/user-attachments/assets/820c7157-7fe0-4253-b02f-1e0d2a8c7e7d" />
Author
Parents
Loading