No description
Find a file
Benjamin Woodruff 5017a41c75
feat(turbopack): Attempt to detect and warn about slow file IO (#66057)
We'd like to warn users if they have particularly slow file IO, so that they can correct the problem themselves, and don't send us reports of poor performance.

- Feature request: https://vercel.slack.com/archives/C03KAR5DCKC/p1716051650641529
- Tweet about how Bun does this: https://x.com/jarredsumner/status/1637549427677364224
- Bun implementation: 06a9aa80c3/src/install/install.zig (L3038)

**Why 100ms?** Bun used to use 10ms, found it too noisy, and switched to 100ms.

This benchmark should run non-blocking in the background and should not meaningfully slow down server startup (even on slow disks).

## Simulated Testing

I looked around and found https://github.com/schoentoon/slowpokefs/. It hasn't been updated in 10 years, but still seems to build fine.

In a nextjs project directory, turn `.next` into an artifically slow mount point:

```
fusermount -uz .next; rm -rf .next .next.real && mkdir .next .next.real && ~/slowpokefs/slowpokefs -m 50 -M 50 --no-slow-read -F .next.real .next
```

<img width="695" alt="Screenshot 2024-05-21 at 4 14 58 PM" src="https://github.com/vercel/next.js/assets/180404/217d7692-33cf-42b7-bbf7-5a530b9e0df1">

Run `pnpm dev --turbo` and see that the warning is generated.

## "Real World" Testing

The following tests are from a linux VM using virtiofs to connect to a 5400 RPM USB 2.0 HDD with APFS:

Only the .next is on an HDD (bind mount):
Otherwise idle disk: `4.86ms 4.44ms 5.31ms`
Otherwise busy disk (copying files): `69.34ms 53.75ms 25.12ms`

The whole project directory is on the HDD (more realistic):
Otherwise idle disk: `20.29ms 35.61ms 48.12ms`
Otherwise busy disk (copying files): `131.40ms 21.71ms 87.33ms`

Most of the time the threshold was not reached, but the 131.40ms test did trigger the warning!

Fixes PACK-3087
2024-05-23 09:52:33 -07:00
.cargo chore: remove unused rust dependencies (#62176) 2024-04-16 17:48:06 +02:00
.config Update teamname in codeowners (#57775) 2023-10-31 12:33:13 +00:00
.devcontainer re-enable next-dev-tests (#47087) 2023-03-14 16:05:19 +01:00
.github Check access token early during release (#66133) 2024-05-23 15:33:37 +00:00
.husky add pre-push hook to guard against accidental pushes directly to canary (#66030) 2024-05-21 12:54:05 +02:00
.vscode chore: add git blame ignore-revs support to gitlens for vscode configuration (#65762) 2024-05-14 14:18:10 -07:00
bench chore: update prettier to 3.2.5 (#65092) 2024-05-08 21:47:14 +02:00
contributing chore: rename 'example bug' label to 'examples' (#64775) 2024-04-19 12:39:44 +02:00
docs Stabilize swrDelta config (#66108) 2024-05-23 08:46:57 -05:00
errors chore(docs): remove suggestion of manually installing sharp (#66034) 2024-05-21 15:42:55 +00:00
examples Update Google Analytics example for App Router (#66021) 2024-05-21 20:47:09 +00:00
packages feat(turbopack): Attempt to detect and warn about slow file IO (#66057) 2024-05-23 09:52:33 -07:00
patches [Memory] Add option to reduce memory usage caused by duplicate strings in webpack-sources (#66003) 2024-05-22 15:30:05 -05:00
scripts add missing -y to start-release 2024-05-23 08:09:29 -07:00
test Revert "Don't fail the build if @types/ packages appear to be missing" (#66130) 2024-05-23 09:01:10 -05:00
turbo/generators fix(generators): update errors gen (#60233) 2024-01-04 20:22:21 +01:00
.alexignore Integrate next-* crates from Turbopack (#47019) 2023-03-13 14:33:17 +01:00
.alexrc docs: Add "special" to the Alex allowlist (#48021) 2023-04-06 16:32:06 +02:00
.eslintignore Improve top level await coverage (#64508) 2024-04-17 17:44:40 +02:00
.eslintrc.json Use new JSX transform (#56294) 2023-12-09 00:17:50 +01:00
.git-blame-ignore-revs chore: add git blame ignore-revs support to gitlens for vscode configuration (#65762) 2024-05-14 14:18:10 -07:00
.gitattributes chore: update gitattributes with linguist-vendored (#54683) 2023-08-28 21:50:19 +00:00
.gitignore ci: report daily turbo integration test results from this repo (#58965) 2023-12-04 16:18:42 +01:00
.node-version Update .node-version (#56460) 2023-10-05 07:40:12 +00:00
.npmrc fix: npm publish provenance permissions (#48757) 2023-04-24 14:08:55 +00:00
.prettierignore chore: update prettier to 3.2.5 (#65092) 2024-05-08 21:47:14 +02:00
.prettierrc.json chore(examples): use default prettier for examples/templates (#60530) 2024-01-11 16:01:44 -07:00
.rustfmt.toml build(cargo): move workspaces manifest to top level (#48198) 2023-04-19 18:38:36 +02:00
azure-pipelines.yml use pathToFileUrl to make esm import()s work with absolute windows paths (#64386) 2024-04-12 19:58:13 +02:00
Cargo.lock feat(turbopack): Attempt to detect and warn about slow file IO (#66057) 2024-05-23 09:52:33 -07:00
Cargo.toml Update lightningcss to 1.0.0-alpha.56 (#66046) 2024-05-21 18:28:59 +00:00
CODE_OF_CONDUCT.md updated code of conduct to v2.1 (#34208) 2022-02-10 18:11:42 -06:00
contributing.md chore: improve repo templates (#46629) 2023-03-01 09:25:51 -08:00
jest.config.js test: use replay jest runner to add current test name to recording (#60438) 2024-01-10 10:31:32 +01:00
jest.replay.config.js Add Replay integration for dev e2e tests (#40955) 2022-09-29 14:45:10 -07:00
lerna.json v14.3.0-canary.79 2024-05-23 14:45:18 +00:00
license.md chore: update Copyright time from 2023 to 2024 (#60071) 2024-01-02 11:06:02 -08:00
lint-staged.config.js [eslint] Fix lint-staged to ensure eslint is ran (#65622) 2024-05-10 12:50:01 -06:00
package.json Update React from 81c5ff2e04 to f994737d14 (#66093) 2024-05-22 19:34:06 -07:00
pnpm-lock.yaml v14.3.0-canary.79 2024-05-23 14:45:18 +00:00
pnpm-workspace.yaml Remove next-dev and its test suite and benchmarks (#55983) 2023-09-26 05:22:39 +02:00
readme.md
release.js chore: update labels in workflows/templates (#63713) 2024-04-17 14:28:51 +02:00
run-tests.js Support React 19 in App and Pages router (#65058) 2024-05-07 18:18:32 +02:00
rust-toolchain.toml chore: remove unused rust dependencies (#62176) 2024-04-16 17:48:06 +02:00
socket.yaml chore(ci): add socket.yaml (#54446) 2023-08-23 18:12:51 +00:00
test-file.txt
tsconfig-tsec.json Integrate tsec into the linting process (#33746) 2022-02-24 16:59:18 -08:00
tsconfig.base.json Stop using baseUrl in root tsconfig (#64117) 2024-04-09 00:25:43 +02:00
tsconfig.json chore: extends from shared base tsconfig (#59776) 2023-12-19 18:52:22 +01:00
tsec-exemptions.json next/script: Correctly apply async and defer props (#52939) 2024-04-15 15:01:50 -07:00
turbo.json Revert turborepo to 1.13.3-canary.2 cont. (#64895) 2024-04-22 23:40:49 +00:00
UPGRADING.md docs: update broken link in UPGRADING.md (#60342) 2024-01-06 14:46:07 -08:00
vercel.json Silence GH Comments for Preview URLs (#18766) 2020-11-03 21:59:47 +00:00

Next.js

Getting Started

Used by some of the world's largest companies, Next.js enables you to create full-stack web applications by extending the latest React features, and integrating powerful Rust-based JavaScript tooling for the fastest builds.

Documentation

Visit https://nextjs.org/docs to view the full documentation.

Community

The Next.js community can be found on GitHub Discussions where you can ask questions, voice ideas, and share your projects with other people.

To chat with other community members you can join the Next.js Discord server.

Do note that our Code of Conduct applies to all Next.js community channels. Users are highly encouraged to read and adhere to them to avoid repercussions.

Contributing

Contributions to Next.js are welcome and highly appreciated. However, before you jump right into it, we would like you to review our Contribution Guidelines to make sure you have a smooth experience contributing to Next.js.

Good First Issues:

We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place for newcomers and beginners alike to get started, gain experience, and get familiar with our contribution process.

Authors

A list of the original co-authors of Next.js that helped bring this amazing framework to life!


Security

If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and NOT open a public issue. We will investigate all legitimate reports. Email security@vercel.com to disclose any security vulnerabilities. Alternatively, you can visit this link to know more about Vercel's security and report any security vulnerabilities.