-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(reporters): update summary only when needed #7291
Conversation
@vitest/browser
@vitest/coverage-v8
@vitest/expect
@vitest/coverage-istanbul
@vitest/mocker
@vitest/pretty-format
@vitest/runner
@vitest/spy
@vitest/snapshot
@vitest/ui
@vitest/utils
vite-node
@vitest/web-worker
vitest
@vitest/ws-client
commit: |
📝 Ran ecosystem CI: Open
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR fixed the performance issue for me.
/** | ||
* Queue new render update | ||
*/ | ||
schedule() { | ||
if (!this.renderScheduled) { | ||
this.renderScheduled = true | ||
this.flushBuffer() | ||
|
||
setTimeout(() => { | ||
this.renderScheduled = false | ||
}, 100).unref() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now similar to Jest: /~https://github.com/jestjs/jest/blob/5f26f09cc5bbf0d82faa6f91f77283db7246cfbb/packages/jest-reporters/src/Status.ts#L210-L220
And for DEFAULT_RENDER_INTERVAL_MS
: /~https://github.com/jestjs/jest/blob/5f26f09cc5bbf0d82faa6f91f77283db7246cfbb/packages/jest-reporters/src/Status.ts#L108
ede40e0
to
428c6c5
Compare
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
##### [v3.0.3](/~https://github.com/vitest-dev/vitest/releases/tag/v3.0.3) ##### 🐞 Bug Fixes - **browser**: - Don't throw a validation error if v8 coverage is used with filtered instances - by [@sheremet-va](/~https://github.com/sheremet-va) in vitest-dev/vitest#7306 [<samp>(fa463)</samp>](vitest-dev/vitest@fa4634b2) - Don't fail when running --browser.headless if the browser projest is part of the workspace - by [@sheremet-va](/~https://github.com/sheremet-va) in vitest-dev/vitest#7311 [<samp>(e43a8)</samp>](vitest-dev/vitest@e43a8f56) ##### 🏎 Performance - **reporters**: Update summary only when needed - by [@AriPerkkio](/~https://github.com/AriPerkkio) in vitest-dev/vitest#7291 [<samp>(7f36b)</samp>](vitest-dev/vitest@7f36b6f9) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.2...v3.0.3)
##### [v3.0.3](/~https://github.com/vitest-dev/vitest/releases/tag/v3.0.3) ##### 🐞 Bug Fixes - **browser**: - Don't throw a validation error if v8 coverage is used with filtered instances - by [@sheremet-va](/~https://github.com/sheremet-va) in vitest-dev/vitest#7306 [<samp>(fa463)</samp>](vitest-dev/vitest@fa4634b2) - Don't fail when running --browser.headless if the browser projest is part of the workspace - by [@sheremet-va](/~https://github.com/sheremet-va) in vitest-dev/vitest#7311 [<samp>(e43a8)</samp>](vitest-dev/vitest@e43a8f56) ##### 🏎 Performance - **reporters**: Update summary only when needed - by [@AriPerkkio](/~https://github.com/AriPerkkio) in vitest-dev/vitest#7291 [<samp>(7f36b)</samp>](vitest-dev/vitest@7f36b6f9) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.2...v3.0.3)
Description
v3.0.2
and^v2
Vitest was updating whole terminal every 16ms.I'm unable to reproduce this using repro from #7285, but generated artificial test setup inside Windows VM. Using
cmd.exe
the execution time dropped from 50s to 38s in that setup. With Git Bash or Powershell there were no performance issues or any changes. On MacOS I'm unable to reproduce this at all.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.