Closed evanmiller closed 5 years ago
Hi @evanmiller, I have taken an initial step in this direction. The issue with the way the sorting is implemented at the moment is that even though the templates are now sorted by modified timestamp in the initial search, these end up in a hash and order isn't guaranteed in the loop that processes them. I will eventually add these to a sortable list before processing. These are now correctly sorted before rendering.
Also, I have implemented a first pass at a render queue construct. I have noticed a slight reduction in build times in my tests. Eventually I will start tracking all template modified timestamps and make some smarter decisions about what to render and ways to avoid re-rendering files that have no template modifications (layout, partials, or page).
For now, please test this latest update and let me know if you run into any issues.
Thanks,
Sam
Thanks. Works fine, I'm seeing an improvement as well, esp. with system time. I'd still like to see the HTML files appear incrementally as my total build time is still over 5 minutes.
Smart re-rendering or anything else that you can do to cut down build time would be very much appreciated. I'm now using Uzu in production on my personal website (evanmiller.org) with 70+ templates. At this point I have to test changes directly in the build/
folder and then port changes back over to the template files. Not ideal, but I'll manage for now.
Keep up the good work!
Nice, thanks for the positive feedback. I really do appreciate your input and ideas. Expect some progress on partial builds within the next few weeks.
@evanmiller, i have added a modification that changes the build behavior.
uzu --clear build
to have uzu use the old behavior. Also added uzu clear
.public/
or themes/**/assets/
these will not be deleted from build/
until you do a full rebuild (uzu --clear build
).The next target will be the piecemeal builds and limiting partial template renders to only partials that are included in the layout, page, or referenced from page/layout partial templates.
Please let me know if the new modifications break anything for you.
@scmorrison, this change is very welcome. It will definitely speed up my development when I am working on new pages.
One issue I encountered is that modifications to i18n
do not force the affected template files to be rebuilt.
@evanmiller, good timing. i just committed a fix for the i18n timestamps. Those should also trigger a rebuild now.
For large builds it would be nice if HTML files were written to disk as they became available, rather than all at once. It would also be convenient if pages were compiled from newest to oldest mtime, so that templates that I'm working on would be compiled (and available for inspection) first.