Skip to content

Reduce FS calls when outputting static and prerender outputs - #134

Open
andrewimm wants to merge 3 commits into
nextjs:mainfrom
andrewimm:imm/fewer-fs-calls
Open

andrewimm wants to merge 3 commits into
nextjs:mainfrom
andrewimm:imm/fewer-fs-calls

Conversation

@andrewimm

Copy link
Copy Markdown
Contributor

Speed up benchmarks by 20-30% on Linux by reducing the number of file IO operations.

  1. fs-extra tries to ensure success by stat-ing the file and checking the parent dir. If we are confident the file and dir already exist, why do this?
  2. Avoid constantly re-creating dirs. We memoize the promises for dir creation, so they immediately resolve if the operation already completed.

Also adding the COPYFILE_FICLONE flag is an optimistic, zero-cost improvement. It'll only work on CoW filesystems (ZFS, Btrfs, and similar) and I'm not sure we use that in build containers today. But it costs nothing now, and will give us improvements if we do support CoW in the future.

@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@andrewimm is attempting to deploy a commit to the vtest314-next-adapter-e2e-tests Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dcba7a5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@next-community/adapter-vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
adapter-vercel-adapter Ready Ready Preview Oct 13, 2026 4:49pm UTC

Comment thread packages/adapter/src/outputs.ts Outdated

This branch was successfully deployed

1 active deployment
Preview — dcba7a5b Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants