-jobs ‹n›, --workers ‹n›, or -j ‹n› —
use up to ‹n› parallel processes. By default, raco setup uses (processor-count) jobs, which typically uses all of the machine’s processing cores.
On Apr 22, 2019, at 8:21 AM, Joel Dueck <dueck...@gmail.com> wrote:Would it be feasible to add some optional parallelism to Pollen, either as an argument to raco pollen render or as an alternate form of render-batch?
`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 Apr 22, 2019, at 11:26 AM, Joel Dueck <dueck...@gmail.com> wrote:But based on what you said I would have expected the subsequent render to take less time than the preheat.
(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!)
PS a couple quick tests, in both cases showing the parallel render takes about 2/3 the time.