Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: lazy create stats in runner #9469

Merged
merged 1 commit into from
Feb 26, 2025
Merged

test: lazy create stats in runner #9469

merged 1 commit into from
Feb 26, 2025

Conversation

LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Feb 26, 2025

Summary

Should not call stats.toJson in test runner if __STATS__ is not used.

Before:
image

After:
image


This pull request involves significant changes to the rspack-test-tools package, primarily focusing on modifying how compiler statistics are handled and passed around. The major changes include introducing a createStatsGetter method, updating various runner classes to use this new method, and altering test cases to reflect these changes.

Major Changes:

Enhancements to Statistics Handling:

  • Introduced the createStatsGetter method in BasicRunnerFactory to cache and retrieve compiler statistics efficiently.
  • Updated createRunner method in multiple runner classes (BasicRunnerFactory, MultipleRunnerFactory, NormalRunnerFactory, WatchRunnerFactory) to use the createStatsGetter method instead of directly passing statistics. [1] [2] [3] [4] [5] [6] [7]

Interface Changes:

  • Modified IBasicRunnerOptions to use a function returning TCompilerStatsCompilation instead of directly using the type. [1] [2]

Test Case Updates:

  • Updated test cases to use __STATS__ instead of STATS_JSON to align with the new statistics handling approach. [1] [2] [3] [4] [5] [6]

These changes improve the efficiency and consistency of how compiler statistics are accessed and used across different parts of the rspack-test-tools package.

Checklist

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

Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 68226ca
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/67beac31f3eeea0008ce96da
😎 Deploy Preview https://deploy-preview-9469--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

codspeed-hq bot commented Feb 26, 2025

CodSpeed Performance Report

Merging #9469 will not alter performance

Comparing test/lazy-runner-stats (68226ca) with main (334099c)

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

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 requested a review from SyMind February 26, 2025 06:23
@LingyuCoder LingyuCoder merged commit 912f2b3 into main Feb 26, 2025
37 checks passed
@LingyuCoder LingyuCoder deleted the test/lazy-runner-stats branch February 26, 2025 06:29
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