test: should not call stats toJson if not necessary#9434
Merged
LingyuCoder merged 1 commit intomainfrom Feb 24, 2025
Merged
Conversation
✅ Deploy Preview for rspack canceled.
|
CodSpeed Performance ReportMerging #9434 will not alter performanceComparing 🎉 Hooray!
|
SyMind
approved these changes
Feb 24, 2025
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.
Summary
Not to call
stats.toJsonif it is not necessary. This may improve the performance of CI on windows. The following comparison is just a sample. It may also be affected by machine fluctuations.Before:

After:

This pull request introduces several enhancements and fixes to the
rspack-test-toolspackage, focusing on improved handling and output of compiler statistics. The most important changes include the addition of new types for multi-stats, updates to various processors to handle these types, and the introduction of new configuration options for writing stats output and JSON files.Enhancements to Compiler Statistics Handling:
Added new types
TCompilerMultiStatsto handle multi-stats for bothRspackandWebpackcompilers. (packages/rspack-test-tools/etc/test-tools.api.md[1]packages/rspack-test-tools/src/type.ts[2]Updated
ITestCompilerManagerinterface to returnTCompilerStatsorTCompilerMultiStatsin thegetStatsmethod. (packages/rspack-test-tools/etc/test-tools.api.md[1]packages/rspack-test-tools/src/type.ts[2]Processor Updates:
BasicProcessor,HashProcessor,HotSnapshotProcessor,SimpleTaskProcessor,SnapshotProcessor,StatsAPIProcessor,StatsProcessor, andWatchProcessorto handle the new multi-stats types and write stats output and JSON files based on the new configuration options. (packages/rspack-test-tools/src/processor/basic.ts[1] [2] [3]packages/rspack-test-tools/src/processor/hash.ts[4]packages/rspack-test-tools/src/processor/hot-step.ts[5]packages/rspack-test-tools/src/processor/simple.ts[6]packages/rspack-test-tools/src/processor/snapshot.ts[7]packages/rspack-test-tools/src/processor/stats-api.ts[8]packages/rspack-test-tools/src/processor/stats.ts[9] [10] [11]packages/rspack-test-tools/src/processor/watch.ts[12] [13] [14]Configuration Updates:
writeStatsOuptutandwriteStatsJsonto control the writing of stats output and JSON files. (packages/rspack-test-tools/etc/test-tools.api.md[1]packages/rspack-test-tools/src/type.ts[2]Test Configurations:
writeStatsOuptutandwriteStatsJsonoptions. (packages/rspack-test-tools/tests/configCases/module/rspack-issue-1652/test.config.js[1]packages/rspack-test-tools/tests/configCases/module/rspack-issue-5548/test.config.js[2]packages/rspack-test-tools/tests/configCases/output/rspack-issue-4338/test.config.js[3]packages/rspack-test-tools/tests/configCases/plugins/swc-js-minifier/test.config.js[4]packages/rspack-test-tools/tests/configCases/split-chunks/max-size-fit/test.config.js[5]packages/rspack-test-tools/tests/watchCases/chunk-ids/id-equals-name/test.config.js[6]Checklist