ionide / Fornax

Scriptable static site generator using type safe F# DSL to define page templates.
MIT License
241 stars 44 forks source link

Improve perf by caching generators #65

Closed robertpi closed 4 years ago

robertpi commented 4 years ago

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 commented 4 years ago

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

robertpi commented 4 years ago

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.

robertpi commented 4 years ago

Supports cache invalidation in watch mode now.

Krzysztof-Cieslak commented 4 years ago

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!

robertpi commented 4 years ago

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.