Repository navigation
Stabilizing importDurations (previously printImportBreakdown)
#9224
Replies: 3 comments 1 reply
|
Hey! First I want to say that this is a great idea to help debugging test performance issues. I myself tried to get such information for my project's test suite using a custom reporter and the I computed average and total import times for each module in a rather simplistic way, and so I'm sure using the built-in export default defineConfig({
// ...
experimental: {
printImportBreakdown: {
top: 50, // show the Top 50 imports instead of the default 10
onlyExternal: true // show only imports from `node_modules`
// and maybe more ?
}
}
// ...
}) |
|
This is now stable in Vitest 5. |
|
Not sure if the site just needs to be updated since this discussion is closed, but it still links here for feedback, so: This was extremely helpful, thank you! Between this and some information from the performance guides, I was able to more than quadruple our testing speed (the problem was barrel files). I mostly just wanted to leave some positive feedback here since it's a little empty, but I'll also mention that I'm not entirely clear on what "self" and "total" mean. The docs say:
Going off of that, I would think "self" would be the time to read the module file and "total" would be the time to read both the module file and all the module files it imports recursively. But I'm not sure this is right because the self time seems to vary a lot more than I would expect, up to more than a second in some cases (if I remember correctly). Maybe it just has to do with file caching or some other magic happening in the background, but regardless, it might be nice for the docs to be a little more clear on what these numbers mean. (I don't really need it myself now, but if I'm unclear about something, there are probably others who are as well.) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
experimental.importDurationsimportDurationsΒ #9533All reactions