Open noteflakes opened 9 years ago
Hmm, this seems to be a bit more complicated than I thought. An alternative approach:
OK, parsing in parallel shaves off a few seconds, but still work to do on translating to lilypond. For that to happen we will need to turn the translate function into a pure function that gives a bunch of lilypond streams as result, without affecting the work state. In general, #preserve_state is a bit hacky, if we need to use it each time we process a file.
For more performance improvements, see #43
Another possibility of parallelizing compilation is to take advantage of movement page breaks, which when rendered create separate \bookPart sections. Each section is rendered separately, then compiled separately. The result is then combined into a single PDF using pdftk.
Finally we don't use pdftk for PDF merging (another tool to install, ruby gem has dependencies the size of the Himalayas), but rather a pure ruby gem called combine_pdf.
Not so fast, Dark Helmet! Silly me, I forgot all about page numbers. When dividing into bookparts, each bookpart will start at page 1. So , for now we disable parallelized bookparts, until we find an acceptable solution. See commit ce3866e.
When processing a directory, things can be parallelized: