lilypond-user
[Top][All Lists]
Advanced

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

Re: Lilypond performance


From: Urs Liska
Subject: Re: Lilypond performance
Date: Tue, 10 Aug 2010 10:47:26 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5

Well, this seems a misunderstanding, mainly due to my English and the fact, that I only have very intermediate programming experience with very little theoretical background.
I think basically we want to say the same thing :-)

I don't find it natural to "walk through" the music from beginning to end.
What I wanted to say is: Only if this would be possible one could expect a linear increase in processing time with longer scores. As it is not possible I find it "natural" that processing time increases exponentially.

Maybe there are possible algorithms to substantially simplify or streamline the tasks lilypond has to do - I don't have the theoretical background to tell. But if it's not possible (which I assume), all I wanted to say is that you can only work around the problem with better hardware.
Of course this is not a real solution to the problem...

Hope this is clearer now.
Best
Urs

Am 10.08.2010 10:31, schrieb David Kastrup:
Urs Liska<address@hidden>  writes:

Am 07.08.2010 09:14, schrieb David Kastrup:
Graham Percival<address@hidden>   writes:


On Thu, Aug 05, 2010 at 05:26:15AM -0700, ornello wrote:

In my installation, Lilypond runtime seems to increase exponentially (at
least not linearly) with the number of pages to engrave. Is there any option
to speed up Lilypond, e.g. by removing time-consuming engravers, such that
the performance only increases (almost) linearly with the number of pages?

There's a section in the Learning manual called "speeding up
lilypond", or something like that.  This sounds like a good place
to look.

Essentially exponential behavior can't really be cured with anything
except fixing the algorithm.

Can one expect a program like LilyPond to work in a linear fashion?
The question is not what one can expect, but what one can achieve.  I do
think that the optimization problem can be reduced essentially to one of
linear programming.  That's what TeX's linebreaking does.  The reason
that this has not been extended to TeX's pagebreaking is
a) memory requirements at its creation time were such that it was
utterly infeasible to keep significantly more than one page in-memory.
b) page composition was done using an "output routine" provided by the
user, in a language that was not side-effect free and requiring global
assignments.

Both of these constraints are not inherently present with Lilypond.
Linear programming techniques for this optimization problem are
basically O(n), where things like maximum measures per line/page
contribute a large constant factor depending on things like font and
paper size.  Combined page/line breaking has an expensive impact on that
factor, but you still have basically linear performance for finding the
optimum candidate among a set with exponentially growing size.

IIUC a linear increase could only be expected if lily would just
"walk" through the score from beginning to end.  But if it has to
process the score as a whole (i.e. "still know at the end what was at
the beginning" or "know the end before typesetting the first barline")
I find it quite natural that its usage of processing time and probably
memory increases exponentially.
Whether or not you consider it "natural" to walk through the whole
candidate space without pruning, it is useless for non-trivial scores.

While practically any software may be improved and optimized I think
that if the scores become too complex to be handled within an
acceptable amount of time the only real solution is new hardware.
I repeat: you can't fight exponential complexity with hardware (or with
peephole optimization).





reply via email to

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