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): cache useNativeEsbuild result #1309

Merged
merged 2 commits into from
Feb 11, 2022

Conversation

sorin-davidoi
Copy link
Contributor

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

Summary

Since the result will be the same for all transformer instances we can cache the result, thus avoiding resolving and spawning redundant processes.

For a test harness with ~3800 tests grouped in ~110 projects this translates to a reduction in running time of ~20s. Attaching a screenshot of the profile that shows how instantiation takes ~20s.

image

Test plan

The existing tests are passing (npm test). Our existing test harness runs without any issues with this patch.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Since the result will be the same for all transformer instances we can cache the result, thus avoiding resolving and spawning redundant processes.

For a test harness with ~3800 tests grouped in ~110 projects this translates to a reduction in running time of ~20s.
src/ng-jest-transformer.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@ahnpnl ahnpnl left a comment

Choose a reason for hiding this comment

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

thanks!

@ahnpnl ahnpnl merged commit 3412142 into thymikee:main Feb 11, 2022
@sorin-davidoi sorin-davidoi deleted the transformer-cache-native-esbuild branch February 14, 2022 08:34
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