noteflakes / lydown

A language for music notation
http://ciconia.github.io/lydown
MIT License
24 stars 0 forks source link

Parallelize source file processing #5

Open noteflakes opened 9 years ago

noteflakes commented 9 years ago

When processing a directory, things can be parallelized:

noteflakes commented 9 years ago

Hmm, this seems to be a bit more complicated than I thought. An alternative approach:

noteflakes commented 9 years ago

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.

noteflakes commented 9 years ago

For more performance improvements, see #43

noteflakes commented 9 years ago

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.

noteflakes commented 9 years ago

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.

noteflakes commented 9 years ago

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.