Skip to content

test(typescript-estree): split up parse #6092

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

Merged
merged 12 commits into from
Jan 16, 2023

Conversation

Beraliv
Copy link
Contributor

@Beraliv Beraliv commented Nov 25, 2022

PR Checklist

Overview

Split parse.test.ts test to be more paralleliseable. When I split parseAndGenerateServices into these files:

  • parse.moduleResolver.default-program-error.test.ts
  • parse.moduleResolver.default-program-success.test.ts
  • parse.moduleResolver.placeholder-error.test.ts
  • parse.moduleResolver.placeholder-success.test.ts

Performance runs

MacBook Air M1:

Command Mean [s] Min [s] Max [s] Relative Diff ((main - branch) / main x 100%)
yarn jest parse (no cache, main) 30.375 ± 0.978 29.255 31.468 1.00 0%
yarn jest parse (with cache, main) 29.299 ± 0.360 28.858 29.833 1.00 0%
yarn jest parse (no cache, N moduleResolver) 29.843 ± 0.904 28.884 30.883 1.00 -1.75%
yarn jest parse (cache, N moduleResolver) 25.544 ± 0.319 25.227 26.065 1.00 -12.82%

Another check for MacBook Pro 2.3 GHz 8-Core Intel Core i9

Command Mean [s] Min [s] Max [s] Relative Diff ((main - branch) / main x 100%)
yarn jest parse (no cache, main) 31.185 ± 0.587 30.764 32.221 1.00 0%
yarn jest parse (with cache, main) 29.330 ± 0.059 29.253 29.411 1.00 0%
yarn jest parse (no cache, N moduleResolver) 24.311 ± 1.148 23.217 25.992 1.00 -22.04%
yarn jest parse (with cache, N moduleResolver) 24.087 ± 3.323 20.569 29.384 1.00 -17.88%

So I think maybe parallelisation isn't working properly on my MacBook Air M1 as on MacBook Pro we see significant improvement

Another split was done here – #6049, but I closed it as it was less performant on MacBook Pro 2.3 GHz 8-Core Intel Core i9.

Commands:

  1. No cache – hyperfine --runs 5 -p "yarn jest --clearCache" "yarn jest parse" --export-markdown performance.md
  2. With cache – hyperfine --runs 5 "yarn jest parse" --export-markdown performance.md

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @Beraliv!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@nx-cloud
Copy link

nx-cloud bot commented Nov 25, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit bf051b1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 47 targets

Sent with 💌 from NxCloud.

@netlify
Copy link

netlify bot commented Nov 25, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit bf051b1
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/63c5df2b4478e800085d5ce2
😎 Deploy Preview https://deploy-preview-6092--typescript-eslint.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 settings.

@Beraliv Beraliv changed the title Test/parallelisation 3 test(typescript-estree): split up parse Nov 25, 2022
@Beraliv Beraliv marked this pull request as ready for review November 25, 2022 09:04
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good start, thanks for sending it!

I think some of the copy & pasted code can be trimmed down. Thoughts?

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Nov 27, 2022
@Beraliv
Copy link
Contributor Author

Beraliv commented Dec 3, 2022

Sorry for no progress, I will do it today

clean packages/typescript-estree/tests/lib/parse.moduleResolver.default-
program-error.test.ts
clean parse.moduleResolver.default-program-success.test.ts
clear parse.moduleResolver.placeholder-error.test.ts
clear parse.moduleResolver.placeholder-success.test.ts
@Beraliv
Copy link
Contributor Author

Beraliv commented Dec 4, 2022

I've double checked performance on MacBook Air M1 again (with charger on) and it looks like that:

Command Mean [s] Min [s] Max [s] Diff ((main - branch) / main x 100%)
yarn jest parse (no cache, main) 20.380 ± 0.599 19.529 21.021 0%
yarn jest parse (cache, main) 17.924 ± 0.289 17.477 18.239 0%
yarn jest parse (no cache, N moduleResolver) 17.675 ± 0.253 17.361 17.996 -13.27%
yarn jest parse (cache, N moduleResolver) 16.216 ± 0.556 15.414 16.872 -9.53%

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far, thanks for continuing to work on it! 🙌

Requesting changes on just a bit more deduplication. But this is feeling very close to merge. 😄

@JoshuaKGoldberg JoshuaKGoldberg removed the awaiting response Issues waiting for a reply from the OP or another party label Jan 16, 2023
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, this is looking great! Thanks a bunch for all your work on this @Beraliv! 🔥

@JoshuaKGoldberg JoshuaKGoldberg enabled auto-merge (squash) January 16, 2023 23:36
@Beraliv
Copy link
Contributor Author

Beraliv commented Jan 16, 2023

Fantastic, this is looking great! Thanks a bunch for all your work on this @Beraliv! 🔥

Thank you for the help and the patience!

@JoshuaKGoldberg JoshuaKGoldberg merged commit 9e4595e into typescript-eslint:main Jan 16, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2023
@Beraliv Beraliv deleted the test/parallelisation-3 branch July 9, 2024 19:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repo: Split up parse.test.ts test to be more parallelizeable
2 participants