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

Optimize fileExists callback path #1266

Merged
merged 2 commits into from Mar 11, 2021

Conversation

berickson1
Copy link
Contributor

Instead of looking up filePathKey twice, cache in in the local scope. This isn't a hugely expensive lookup path, but is a hot path on large project recompiles (especially after caches are blown away). Profiling shows that even the Map lookup shows non-trivial cache lookup aggregate time. (Less than a non-cached implementation though :) )
Screen Shot 2021-03-10 at 1 32 07 PM

Instead of looking up filePathKey twice, cache in in the local scope. This isn't a hugely expensive lookup path, but is a hot path on large project recompiles (especially after caches are blown away). Profiling shows that even the Map lookup shows non-trivial cache lookup aggregate time
@johnnyreilly
Copy link
Member

looks good! Can you update the CHANGELOG.md and package.json too please and we'll ship.

@berickson1
Copy link
Contributor Author

berickson1 commented Mar 11, 2021

@johnnyreilly - any idea what's up with the travis test failure? It was clean before I bumped package.json & I don't see any reason why my change should cause the listed failure

Edit: Looks like I'm not the only failure on this https://travis-ci.org/github/TypeStrong/ts-loader/jobs/762060860

@johnnyreilly
Copy link
Member

travis has been flaky for a while and I want to remove it entirely - can't find the relevant setting in GitHub alas. It's intentionally not required so don''t worry.

@johnnyreilly johnnyreilly merged commit c2c1aef into TypeStrong:master Mar 11, 2021
@johnnyreilly
Copy link
Member

This was referenced Mar 11, 2021
This was referenced Mar 15, 2021
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.

None yet

2 participants