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

perf(jest-resolve): skip error creation on not found stat calls #11749

Merged
merged 2 commits into from
Jan 6, 2022

Conversation

markjm
Copy link
Contributor

@markjm markjm commented Aug 13, 2021

Summary

Implements perf improvement for resolving discussed in #11738

Test plan

No user-facing changes requireing e2e testing. Added UT to ensure stacktrace is properly set back to pre-change value

@markjm markjm force-pushed the markjm/resolve-perf branch 2 times, most recently from 859be58 to 807c48c Compare August 14, 2021 18:32
@SimenB
Copy link
Member

SimenB commented Oct 17, 2021

CI is very unhappy, would you be able to take a look 🙂

@markjm
Copy link
Contributor Author

markjm commented Oct 17, 2021

CI is very unhappy, would you be able to take a look 🙂

I will take another look shortly. The issue with CI is that the fix required for this change to work came in a patch version of node@16, so we would need to guard this optimization behind a capability check to meet the version support of jest.

@markjm markjm force-pushed the markjm/resolve-perf branch from 5ff3835 to 1d95a4b Compare October 28, 2021 19:23
@markjm
Copy link
Contributor Author

markjm commented Oct 28, 2021

Chose to use the new option as its even more performant and back-compat is easier. Blocked and waiting on this fix first though

isaacs/node-graceful-fs#220

cc @SimenB

@joux3
Copy link

joux3 commented Jan 4, 2022

Armed with a profiler I arrived at exactly the same optimisation (uvException/captureLargerStackTrace was on top of the profiler entries). For an actual test case real as measured by time for time node ./node_modules/.bin/jest --runInBand singletestxyz (which calls statSyncCached about 12k times) went from 4.0 seconds to about 3.8 seconds (best of 10 runs).

@SimenB
Copy link
Member

SimenB commented Jan 5, 2022

@markjm graceful-fs seems to be patched now, so this is unblocked?

@markjm
Copy link
Contributor Author

markjm commented Jan 5, 2022

Wonderful - will fix up this PR by EOD!

@SimenB
Copy link
Member

SimenB commented Jan 5, 2022

Great! A rebase, updating graceful-fs in package.jsons and a changelog entry would be great 👍

@markjm markjm force-pushed the markjm/resolve-perf branch from 1d95a4b to 12d3562 Compare January 6, 2022 01:12
@markjm markjm force-pushed the markjm/resolve-perf branch from 12d3562 to 23712c6 Compare January 6, 2022 01:15
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2022

Codecov Report

Merging #11749 (061c040) into main (48f68a5) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11749      +/-   ##
==========================================
- Coverage   67.52%   67.51%   -0.01%     
==========================================
  Files         328      328              
  Lines       17246    17246              
  Branches     5071     5071              
==========================================
- Hits        11645    11644       -1     
- Misses       5568     5569       +1     
  Partials       33       33              
Impacted Files Coverage Δ
packages/jest-resolve/src/fileWalkers.ts 67.79% <100.00%> (-1.70%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48f68a5...061c040. Read the comment docs.

@markjm
Copy link
Contributor Author

markjm commented Jan 6, 2022

@SimenB cleaned up the commit and CI is passing. I see all circleCI passing, but its still waiting for approval for some workflow I cant seem to find.

@SimenB SimenB merged commit 11d79ec into jestjs:main Jan 6, 2022
@markjm markjm deleted the markjm/resolve-perf branch January 6, 2022 18:20
@github-actions
Copy link

github-actions bot commented Feb 6, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants