lilypond-devel
[Top][All Lists]
Advanced

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

Re: Draws a line above footnotes (issue4167063)


From: Joe Neeman
Subject: Re: Draws a line above footnotes (issue4167063)
Date: Wed, 23 Feb 2011 18:19:51 +1100

On Wed, Feb 23, 2011 at 3:14 PM, Mike Solomon <address@hidden> wrote:
On Feb 22, 2011, at 7:17 PM, address@hidden wrote:

> On 2011/02/22 15:23:00, MikeSol wrote:

>> On 2011/02/22 01:05:49, joeneeman wrote:
>> > Have you checked the performance of this? This part is linear and so
> it makes
>> > break_into_pieces quadratic. Also, you can make it simpler by
> iterating
>> through
>> > "all-elements" instead of recursing through "elements".
>
>> I've made the change to iterate through all-elements, but I still need
> to
>> measure the performance of the algorithm.  How would I do this?
>
> The change to all-elements was just for simplicity; I still think it
> will be quadratic. You can do a profiling build with
> ./configure --enable-conf=prof --enable-profiling --disable-optimising
> make conf=prof
> (and the binary will be out-prof/bin/lilypond). You can also just time
> lilypond on a largish score (ie. multiple minutes of processing time).
> You can find such scores on the mailing list if you don't have one; Hu
> Haipeng often sends them. Or you can try Valentin's opera, but that's
> more like multiple hours of processing time...
>

You're right - it takes a long time :(

Perhaps it'd be wise to make a footnote switch that allows users to opt-out of this slowness.

Better just to make it faster :). What if you add a vector<Grob*> to System with all the footnoted grobs? The first time get_footnotes_in_range is called, you do the search, populate the vector and sort it according to column rank. From then on, you respond to get_footnotes_in_range by doing a binary search for the upper and lower bounds.

Alternatively, is there a grob that I can acknowledge during the translation process that will always exist and will be easily accessible from the systems?  If so, I can just use the pointer group interface to create a grob array of footnoted grobs.

If you'd rather use an engraver to collect the footnotes, you could just catch all the footnoted items in Score_engraver. You'll still need to sort the array and use binary searches, though.

Cheers,
Joe


reply via email to

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