-
-
Couldn't load subscription status.
- Fork 1.5k
perf: optimize --merge-reports #8710
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
| moduleGraph | ||
| = typeof window.structuredClone !== 'undefined' | ||
| ? window.structuredClone(moduleGraph) | ||
| : toJSON(moduleGraph) |
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.
As I understood toJSON was used as polyfiil. Should we keep it?
structuredClone available in all major browsers for 3 years already https://caniuse.com/wf-structured-clone
| "test": "vitest" | ||
| }, | ||
| "devDependencies": { | ||
| "@ungap/structured-clone": "^1.3.0", |
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.
Should it be?
| "@ungap/structured-clone": "^1.3.0", | |
| "@ungap/structured-clone": "catalog:", |
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.
Yes, let's have it in the catalog file since it's used everywhere
| * Replacer function for serialization methods such as JS.stringify() or | ||
| * flatted.stringify(). | ||
| * flatted.stringify(). // here |
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.
Not sure how to write that comment correctly because the name of dep is more complicated now
| * Replacer function for serialization methods such as JS.stringify() or | ||
| * flatted.stringify(). | ||
| * flatted.stringify(). //here |
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.
|
I am not so sure about tests… I tried to run |
Some tests are indeed flaky, but the changes in your PR clearly broke other tests, like reporters: https://github.com/vitest-dev/vitest/actions/runs/18476660566/job/52642594279?pr=8710 The lint stage should also pass without errors |
|
Just in case: I will continue work on it a bit later. I am short on time during few weeks probably. |
Description
I noticed that
vitest run --merge-reportstakes a lot of time in our CI. After short profiling I discovered that bottleneck is parsing via flatted.Author of flatted suggests to move to https://github.com/ungap/structured-clone
Here are some benchmarks:
And some profiling via cpupro:
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.