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

Improve perf by caching generators #65

Merged
merged 1 commit into from
May 3, 2020

Conversation

robertpi
Copy link
Contributor

@robertpi robertpi commented May 1, 2020

Small change, order of magintude improvement. Tested on 185 page blog:

Pre-change - Generation time: 00:04:59.3250690
Post-change - Generation time: 00:00:19.2490206

@Krzysztof-Cieslak
Copy link
Member

Shouldn’t it also invalidate cache when the generator file is changed?

@robertpi
Copy link
Contributor Author

robertpi commented May 1, 2020

Oh yeah, I was only thinking about the build mode where it runs and exits. I'll take another look at the the watch mode.

Small change, order of magintude improvement. Tested on 185 page blog:

Pre-change - Generation time: 00:04:59.3250690
Post-change - Generation time: 00:00:19.2490206
@robertpi
Copy link
Contributor Author

robertpi commented May 1, 2020

Supports cache invalidation in watch mode now.

@Krzysztof-Cieslak
Copy link
Member

We probably could go even further than this and invalidate cache only in some particular cases (invalidate all when config or any loader has changed, invalidate single entry when the generator has changed. ). But even this is great, thanks a lot!

@Krzysztof-Cieslak Krzysztof-Cieslak merged commit 0a7c669 into ionide:master May 3, 2020
@robertpi
Copy link
Contributor Author

robertpi commented May 3, 2020

I thought about that, and agree it would be a better solution I didn't do it for two reasons:

Next logical step for better perf, for watch mode at least, is calculating which files have changed and just regenerating them.

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