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(transformer): leverage the ts-jest config set cache #1318

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

sorin-davidoi
Copy link
Contributor

@sorin-davidoi sorin-davidoi commented Feb 9, 2022

Summary

Instead of creating ConfigSet instances all the time (which is an expensive operation, as it involves path concatenations, merging configurations, reading from disk...), we use a private method in ts-jest that caches the configurations.

Kind of a follow-up to #1310 and inspired by the discussions in #1313.

This patch results in significant decrease in the execution time of our test harness: from 821s to 694s.

Test plan

npm test is passing. Our test harness runs without any issues with this patch.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Instead of creating ConfigSet instances all the time (which is an expensive operation, as it involves path concatenations, merging configurations, reading from disk...), we use a private method in `ts-jest` that caches the configurations.

Inspired by the discussions in thymikee#1313.

This is the result of applying this patch to one of our small projects:

Before:
Test Suites: 6 skipped, 59 passed, 59 of 65 total
Tests:       7 skipped, 370 passed, 377 total
Snapshots:   0 total
Time:        63.066 s

After:
Test Suites: 6 skipped, 59 passed, 59 of 65 total
Tests:       7 skipped, 370 passed, 377 total
Snapshots:   0 total
Time:        58.326 s
@ahnpnl ahnpnl merged commit d47d1eb into thymikee:main Feb 9, 2022
@sorin-davidoi sorin-davidoi deleted the transformer-cache-config-set branch February 10, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants