Skip to content

perf: launch background tasks immediately #10484

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

CPunisher
Copy link
Collaborator

@CPunisher CPunisher commented May 27, 2025

Summary

Currently the main tasks run in the scheduler thread. If there's a time consuming main task, the scheduler thread will get stuck and doesn't have time to launch the background tasks.

This pr prevents the background tasks from being put into the task queue. Instead, the scheduler launches them as soon as they are returned.

Checklist

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

@github-actions github-actions bot added the release: performance release: performance related release(mr only) label May 27, 2025
Copy link

netlify bot commented May 27, 2025

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 649da70
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6836aa36f4c0d70008bbcf80
😎 Deploy Preview https://deploy-preview-10484--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 project configuration.

@CPunisher

This comment was marked as abuse.

This comment was marked as outdated.

This comment was marked as spam.

Copy link
Contributor

github-actions bot commented May 27, 2025

📝 Benchmark detail: Open

Name Base (2025-05-27 890ae6d) Current Change
10000_big_production-mode_disable-minimize + exec 35.3 s ± 228 ms 36.5 s ± 439 ms +3.25 %
10000_development-mode + exec 1.88 s ± 44 ms 1.81 s ± 14 ms -3.96 %
10000_development-mode_hmr + exec 772 ms ± 10 ms 750 ms ± 27 ms -2.80 %
10000_production-mode + exec 2.33 s ± 38 ms 2.31 s ± 85 ms -0.59 %
10000_production-mode_persistent-cold + exec 2.48 s ± 17 ms 2.45 s ± 50 ms -1.28 %
10000_production-mode_persistent-hot + exec 1.77 s ± 14 ms 1.73 s ± 13 ms -2.48 %
arco-pro_development-mode + exec 1.81 s ± 120 ms 1.81 s ± 53 ms +0.01 %
arco-pro_development-mode_hmr + exec 383 ms ± 3 ms 384 ms ± 4.7 ms +0.06 %
arco-pro_production-mode + exec 3.42 s ± 64 ms 3.47 s ± 79 ms +1.50 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.56 s ± 195 ms 3.62 s ± 60 ms +1.62 %
arco-pro_production-mode_persistent-cold + exec 3.54 s ± 164 ms 3.61 s ± 260 ms +1.95 %
arco-pro_production-mode_persistent-hot + exec 2.13 s ± 31 ms 2.19 s ± 216 ms +2.88 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.46 s ± 87 ms 3.52 s ± 60 ms +1.78 %
large-dyn-imports_development-mode + exec 2.1 s ± 29 ms 2.04 s ± 25 ms -3.26 %
large-dyn-imports_production-mode + exec 2.1 s ± 21 ms 2.12 s ± 101 ms +1.06 %
threejs_development-mode_10x + exec 1.69 s ± 88 ms 1.65 s ± 27 ms -2.71 %
threejs_development-mode_10x_hmr + exec 871 ms ± 15 ms 851 ms ± 11 ms -2.38 %
threejs_production-mode_10x + exec 5.25 s ± 181 ms 5.22 s ± 316 ms -0.55 %
threejs_production-mode_10x_persistent-cold + exec 5.31 s ± 294 ms 5.3 s ± 379 ms -0.27 %
threejs_production-mode_10x_persistent-hot + exec 4.43 s ± 87 ms 4.43 s ± 189 ms -0.00 %
10000_big_production-mode_disable-minimize + rss memory 9266 MiB ± 98.9 MiB 9141 MiB ± 136 MiB -1.34 %
10000_development-mode + rss memory 651 MiB ± 15.8 MiB 657 MiB ± 32.1 MiB +0.87 %
10000_development-mode_hmr + rss memory 786 MiB ± 14.7 MiB 786 MiB ± 17 MiB -0.04 %
10000_production-mode + rss memory 644 MiB ± 1.84 MiB 666 MiB ± 32.6 MiB +3.50 %
10000_production-mode_persistent-cold + rss memory 768 MiB ± 44.4 MiB 771 MiB ± 51.8 MiB +0.42 %
10000_production-mode_persistent-hot + rss memory 762 MiB ± 44.3 MiB 738 MiB ± 13.8 MiB -3.15 %
arco-pro_development-mode + rss memory 593 MiB ± 32.5 MiB 591 MiB ± 60.7 MiB -0.26 %
arco-pro_development-mode_hmr + rss memory 501 MiB ± 44.7 MiB 509 MiB ± 42.1 MiB +1.56 %
arco-pro_production-mode + rss memory 686 MiB ± 65.2 MiB 721 MiB ± 65.5 MiB +5.04 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 688 MiB ± 29.7 MiB 713 MiB ± 47.4 MiB +3.67 %
arco-pro_production-mode_persistent-cold + rss memory 780 MiB ± 90.9 MiB 773 MiB ± 36.6 MiB -0.81 %
arco-pro_production-mode_persistent-hot + rss memory 638 MiB ± 63.1 MiB 649 MiB ± 82.4 MiB +1.74 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 697 MiB ± 52.6 MiB 736 MiB ± 64.4 MiB +5.58 %
large-dyn-imports_development-mode + rss memory 661 MiB ± 5.06 MiB 680 MiB ± 7.49 MiB +2.80 %
large-dyn-imports_production-mode + rss memory 544 MiB ± 6.26 MiB 564 MiB ± 11.3 MiB +3.67 %
threejs_development-mode_10x + rss memory 604 MiB ± 20.7 MiB 622 MiB ± 24.3 MiB +2.91 %
threejs_development-mode_10x_hmr + rss memory 739 MiB ± 20 MiB 734 MiB ± 28.9 MiB -0.59 %
threejs_production-mode_10x + rss memory 882 MiB ± 18.1 MiB 902 MiB ± 20.2 MiB +2.18 %
threejs_production-mode_10x_persistent-cold + rss memory 952 MiB ± 37.5 MiB 966 MiB ± 30.1 MiB +1.56 %
threejs_production-mode_10x_persistent-hot + rss memory 847 MiB ± 18 MiB 842 MiB ± 18.5 MiB -0.59 %

Copy link

codspeed-hq bot commented May 27, 2025

CodSpeed Performance Report

Merging #10484 will not alter performance

Comparing CPunisher:05-27-perf/sync-task (649da70) with main (60e8b26)

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

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

✅ 11 untouched benchmarks

@CPunisher CPunisher marked this pull request as ready for review May 27, 2025 09:58
@CPunisher CPunisher changed the title perf: run sync task in isolated thread perf: launches background tasks immediately May 27, 2025
@CPunisher CPunisher changed the title perf: launches background tasks immediately perf: launch background tasks immediately May 27, 2025
@CPunisher CPunisher force-pushed the 05-27-perf/sync-task branch from f92f4b3 to 649da70 Compare May 28, 2025 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: performance release: performance related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant