On Monday, April 22, 2019 at 10:43:13 AM UTC-5, Matthew Butterick wrote:
>
> `raco pollen setup` operates in parallel, to a maximum of however many
> cores are on your machine (= `(processor-count)`) Run that before `raco
> pollen render`, and it's usually faster than running `raco pollen render`
> alone.
>
> `raco pollen setup` only precompiles & caches the `doc` & `metas`. At one
> point I looked into parallelizing the rest of the render (that is, putting
> `doc` and `metas` into a template and writing output). IIRC what I
> discovered is that part is relatively fast. Also, within a project,
> rendered pages can depend intricately on each other (templates and
> preprocessor files etc). So if you do your parallel render in the wrong
> order, you can end up being slower (because you're re-rendering work you
> don't need to).
>
> Still, parallel rendering isn't hard to implement. So if `raco pollen
> setup` is underwhelming, I can take another look at it.
>
On my `thenotepad` repo [1], which has 72 .poly.pm files in its `posts/`
subfolder, I tried the following sets of commands. Before each set, I did
`rm posts/*.html`, `raco pollen reset` and `touch pollen.rkt`:
1. Cold-start render: `raco pollen render -t html posts/*.poly.pm` = *166
seconds*
2. Setup + render:
1. raco pollen setup posts/ = 65 seconds
2. raco pollen render -t html posts/*.poly.pm = 112 seconds
3. total time *177 seconds*
My CPU was maxed out during `raco pollen setup` and I could see it churning
through them roughly four at a time, so that part is great.
But based on what you said I would have expected the subsequent render to
take less time than the preheat.
Maybe there's something about my template file [2] that makes it especially
slow?
I get what you're saying about tricky interdependencies. We have separate
tools for handling this issue though (makefiles) so as long as it's
possible to specify which files are included in a given batch, it might
still be good to have the option of doing the whole process for the batch
in parallel. (I.e., keep the current behavior the default)
(Incidentally: through trial and [non-] error I discovered I can specify a
subdirectory after `raco pollen setup` and limit it to those files. I was
glad to see this was possible, but it isn't in the docs!)
[1]: https://github.com/otherjoel/thenotepad
[2]: https://github.com/otherjoel/thenotepad/blob/master/template.html.p
--
You received this message because you are subscribed to the Google Groups
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.