You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(build): skip gzip for node_modules files in the size report - #4927
Backport of #4926 to v2. Nuxt 4 prints this report on every build, so this is where most of the gain is.
🔗 Linked issue
None. Follow-up to #4567 and #4569, which touched the same report.
❓ Type of change
📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
🐞 Bug fix (a non-breaking change that fixes an issue)
👌 Enhancement (improving an existing functionality like performance)
✨ New feature (a non-breaking change that adds functionality)
🧹 Chore (updates to the build process or auxiliary tools and libraries)
⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
With logging.compressedSizes on (the default), Nitro gzips every server output file to print the size report. The report never lists node_modules files. It only adds them to the total. They are most of the output, so most of the gzip time goes into one number.
This PR stops gzipping node_modules files. They still count in the total size, and the total gzip now says what it covers:
Σ Total size: 62.1 MB (20.2 MB gzip) # before
Σ Total size: 62.1 MB (952 kB gzip, excluding node_modules) # after
Without node_modules in the output, the log does not change.
I timed generateFSTree in a Nuxt 4 app with 149 traced packages (57 MB in node_modules):
wall
CPU
before, 4 builds
1.6 to 1.9 s
4.7 to 5.4 s
after, 4 builds (same change patched into nitropack 2.13.5)
0.2 to 0.4 s
0.7 to 1.4 s
I also tried gzip level 6 (half the time), level 1 (sizes change by 10 to 15%) and worker threads (no gain, zlib.gzip already uses the thread pool). Skipping node_modules saves the most and keeps the listed sizes exact.
A new unit test checks that only listed files get gzipped.
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 4f0a008c-6298-4f62-8fd9-9454464b4afc
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
Backport of #4926 to
v2. Nuxt 4 prints this report on every build, so this is where most of the gain is.🔗 Linked issue
None. Follow-up to #4567 and #4569, which touched the same report.
❓ Type of change
📚 Description
With
logging.compressedSizeson (the default), Nitro gzips every server output file to print the size report. The report never listsnode_modulesfiles. It only adds them to the total. They are most of the output, so most of the gzip time goes into one number.This PR stops gzipping
node_modulesfiles. They still count in the total size, and the total gzip now says what it covers:Without
node_modulesin the output, the log does not change.I timed
generateFSTreein a Nuxt 4 app with 149 traced packages (57 MB innode_modules):I also tried gzip level 6 (half the time), level 1 (sizes change by 10 to 15%) and worker threads (no gain,
zlib.gzipalready uses the thread pool). Skippingnode_modulessaves the most and keeps the listed sizes exact.A new unit test checks that only listed files get gzipped.
📝 Checklist