Skip to content

test: should not call stats toJson if not necessary#9434

Merged
LingyuCoder merged 1 commit intomainfrom
test/stats-perf
Feb 24, 2025
Merged

test: should not call stats toJson if not necessary#9434
LingyuCoder merged 1 commit intomainfrom
test/stats-perf

Conversation

@LingyuCoder
Copy link
Copy Markdown
Contributor

@LingyuCoder LingyuCoder commented Feb 21, 2025

Summary

Not to call stats.toJson if 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:
image

After:
image


This pull request introduces several enhancements and fixes to the rspack-test-tools package, 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 TCompilerMultiStats to handle multi-stats for both Rspack and Webpack compilers. (packages/rspack-test-tools/etc/test-tools.api.md [1] packages/rspack-test-tools/src/type.ts [2]

  • Updated ITestCompilerManager interface to return TCompilerStats or TCompilerMultiStats in the getStats method. (packages/rspack-test-tools/etc/test-tools.api.md [1] packages/rspack-test-tools/src/type.ts [2]

Processor Updates:

  • Modified BasicProcessor, HashProcessor, HotSnapshotProcessor, SimpleTaskProcessor, SnapshotProcessor, StatsAPIProcessor, StatsProcessor, and WatchProcessor to 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:

  • Introduced new configuration options writeStatsOuptut and writeStatsJson to 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:

  • Updated test configurations to use the new writeStatsOuptut and writeStatsJson options. (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

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Feb 21, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 21, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit a81e1de
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67b89b097014550008a41d5c

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 21, 2025

CodSpeed Performance Report

Merging #9434 will not alter performance

Comparing test/stats-perf (a81e1de) with main (4bbe65a)

🎉 Hooray! codspeed-node just leveled up to 4.0.0!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 7 untouched benchmarks

@LingyuCoder LingyuCoder marked this pull request as ready for review February 22, 2025 03:08
@LingyuCoder LingyuCoder requested a review from SyMind February 22, 2025 03:09
@LingyuCoder LingyuCoder merged commit 121557a into main Feb 24, 2025
37 checks passed
@LingyuCoder LingyuCoder deleted the test/stats-perf branch February 24, 2025 08:12
@h-a-n-a h-a-n-a mentioned this pull request Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants