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: cache results of fs.stat call for each build to improve incremental performance #147

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

mattlewis92
Copy link
Contributor

When profiling our incremental builds I found that on every rebuild we were calling fs.stat many times to the same files. In our app we have a variables.scss + mixins.scss that is imported in basically every stylesheet so these fs.stat calls added up and could add several seconds to our incremental rebuild speed.

So I added a simple cache here to fs.stat calls that is reset in between every build. After applying the patch to our application, this saves us several seconds per rebuild!

@glromeo glromeo merged commit 965ceb6 into glromeo:main Sep 6, 2023
1 check passed
@glromeo
Copy link
Owner

glromeo commented Sep 6, 2023

nice :) ...thank you!

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