lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: aux files to cache compilation info


From: Han-Wen Nienhuys
Subject: Re: aux files to cache compilation info
Date: Mon, 6 Aug 2012 23:41:30 -0300

On Mon, Aug 6, 2012 at 4:36 AM, Ramana Kumar <address@hidden> wrote:
> In this message on users
> http://lists.gnu.org/archive/html/lilypond-user/2012-08/msg00094.html
> Mike mentioned the possibility of generating cache files to speed up
> recompilation. He also said working out the details might take months
> of discussion. I'd like to start that discussion in a relaxed way (we
> have no deadlines after all), at least to generate an archive of
> issues relevant to such a project. (Let me know if this has been
> discussed before.)
>
> People seem to agree that line breaking is the major bottleneck in
> compilation. What would it take to cache just line breaking?
>
> I suggest there are at least (and probably exactly) two things the
> cache needs to contain:
> 1. enough information about the last score compiled to know where the
> new (current) score differs
> 2. line breaking information for the cached score
>
> Given that information, a possible use of the cache is: reuse line
> breaking for any stretch of unchanged score where the line breaks
> happen to be in sync (this always at least includes the stretch from
> the beginning up to the first difference).
>
> Thoughts on how to represent 1 and 2 above, and how to use them (to
> find the stretches in sync)?

I'd forget about the stretches, and do it at a whole score granularity.

Dump a list (moment, breakable?) list as a key; if someone adds a note
anywhere, you have to recompute everything. Later you can refine this;
for the proof of concept it does not have to be more advanced, and
this already lets people quickly iterate on fixing small formatting
details.

For the line breaking, just dump a list of page/line breaks, ie. a list of

  (moment, is-page-break?)

one entry for each line-break. You should be able to plug this in to
the code rather straightforwardly. If you only have to do it once per
line, the spacing computation is actually pretty cheap, so you get
most of the benefit with just this information.

You can use Scheme data structures as a data format.

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]