chore(test): always report vitest worst import time offenders#1428
Merged
Conversation
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (da1f49e) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 1.0 KB | - |
| Bundled (raw) | 11.16 MB | - |
| Bundled (gzip) | 2.10 MB | - |
| Import time | 885ms | +13ms, +1.5% |
bin:sanity
| Metric | Value | vs main (da1f49e) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.78 MB | - |
| Import time | 2.24s | -19ms, -0.8% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (da1f49e0)
| Metric | Value | vs main (da1f49e) |
|---|---|---|
| Internal (raw) | 106.7 KB | - |
| Internal (gzip) | 26.7 KB | - |
| Bundled (raw) | 21.72 MB | - |
| Bundled (gzip) | 3.46 MB | - |
| Import time | 781ms | +2ms, +0.3% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (da1f49e0)
| Metric | Value | vs main (da1f49e) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
9cb4163 to
4746f84
Compare
Contributor
Coverage DeltaNo covered files changed in this PR. Overall Coverage
|
4746f84 to
31aa7ce
Compare
snocorp
approved these changes
Jul 2, 2026
tbeseda
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enables reporting the worst offenders in terms of import times when running tests. More details about this in the Profiling Test Performance Vitest guide.
The use of barrel files in this repository is the top contributor to long import times, but poor mocking in tests is also a factor.
Here is what this addition prints at the end of any vitest test runs (the following taken from this Node 26 on ubuntu CI run in this PR):
Note
Low Risk
Config-only test tooling with no runtime or production impact.
Overview
Enables Vitest’s experimental
importDurationsin the rootvitest.config.tsso every test run prints the top 10 slowest imports (self vs total time) plus aggregate import stats at the end of the run.This is observability only—no change to which tests run, coverage, or reporters. It’s meant to surface heavy import chains (e.g. barrel files) and tests that pull in too much of the app without mocking.
Reviewed by Cursor Bugbot for commit 31aa7ce. Bugbot is set up for automated code reviews on this repo. Configure here.