Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! Wondering if you would be open to making some perf improvements that I identified?
Background:
I've been trying to improve performance on a test suite using Storybook test runner on a Github Actions based CI.
What I did:
I ran the test suite locally profiling with Clinic flame.
react-docgen-typescript
had some very hot blocks in the flame graph that I was able to cool down substantially by caching the results of some functions.For reference, here's the initial run showing
trimFileName.js
as the hottest block in the entire profile. (Updated image, I put the wrong one at first...)Results:
My 33 test suites containing 63 tests in total dropped from ~26 seconds to ~14 seconds.
What I don't know:
If the cache keys I used are safe (could there be name collisions?). If you're interested in this kind of micro optimization for this repo.