Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(chokidar): avoid fs calls on ignored files #12584

Merged
merged 2 commits into from
Mar 26, 2023

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Mar 26, 2023

Description

There are will be some extra fs calls on the ignored files (e.g especially when generating .vite cache) in chokidar. I think we could optimize it. But I also notice that https://github.com/paulmillr/chokidar is less active now, so maybe we can add a pnpm patch for it.

This pr will avoid unnecessary calculations when ignored files change. I tested https://github.com/Lani/vite-2.7-slow before and after this pr. There will be 20-50ms faster after this pr when initial startup.

Additional context

I will send a PR to fix this upstream later. And once it gets merged, we can revert this and upgrade chokidar to the new one.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Mar 26, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Mar 26, 2023

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ❌ failure
iles ❌ failure
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt ✅ success
previewjs ✅ success
qwik ✅ success
rakkas ✅ success
sveltekit ✅ success
vite-plugin-ssr ✅ success
vite-plugin-react ✅ success
vite-plugin-react-pages ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success
windicss ✅ success

@patak-dev
Copy link
Member

Histoire is failing in main, and I got the same error for Iles in #12572 (comment). This looks safe to merge.

Awesome work @sun0day! Let's merge it so we give time for folks to test this while we are in beta.

@patak-dev patak-dev merged commit 24b91d5 into vitejs:main Mar 26, 2023
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.

2 participants