vercel / next.js

The React Framework
https://nextjs.org
MIT License
122.59k stars 26.23k forks source link

Fix dhat support for turbo dev #67166

Open bgw opened 4 days ago

bgw commented 4 days ago

Build next-swc using the dhat feature:

pnpm pack-next --features __internal_dhat-heap

Testing with dev

pnpm dev --turbo

Hit ctrl+c, and see the dhat output:

[dhat]: Teardown profiler
dhat: Total:     10,246,437 bytes in 84,934 blocks
dhat: At t-gmax: 4,129,935 bytes in 42,733 blocks
dhat: At t-end:  4,118,268 bytes in 42,728 blocks
dhat: The data has been saved to dhat-heap.json, and is viewable with dhat/dh_view.html

Check that we didn't regress turbotrace

Modify a project's next.config.mjs to enable turbotrace:

  experimental: {
    turbotrace: {}
  }

run pnpm build and see that we get output from dhat at the end:

dhat: Total:     108,876,305 bytes in 716,123 blocks
dhat: At t-gmax: 53,145,524 bytes in 338,440 blocks
dhat: At t-end:  53,145,524 bytes in 338,440 blocks
dhat: The data has been saved to dhat-heap.json, and is viewable with dhat/dh_view.html
bgw commented 4 days ago

[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bgw and the rest of your teammates on Graphite Graphite