lilypond-user
[Top][All Lists]
Advanced

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

Re: OMG - performance issue with Scheme engraver


From: Urs Liska
Subject: Re: OMG - performance issue with Scheme engraver
Date: Tue, 10 Jul 2018 16:56:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



Am 10.07.2018 um 16:48 schrieb David Kastrup:
Urs Liska <address@hidden> writes:

Hi all,

after completing most of the work of reviewing the scholarly.annotate
module I realize that it (presumably one small change) is a total
performance killer, and I need some help tracking it down.
Well, one thing just jumping out at me is

      ((process-acknowledged translator)
       (for-each
        (lambda (grob)
[...]
                     ;; reset list to prevent multiple processing.
                     ;
                     ; TODO: I don't understand why I can kill *all* the list
                     ; after having processed *one* grob.
                     ; What happens to any other annotated grobs (at the same 
time)?
                     ; I know it is possible to annotate multiple post-events, 
for example.
                     (set! all-grobs '())))))))
        all-grobs))

That's just garbage.  If you want to stop processing the list in spite
of having started it with for-each, you need a non-local jump
(catch/throw).

The list processed by for-each has no connection at all with what you
store in all-grobs inside of the loop.  And it does not appear like you
even bother resetting all-grobs at all when you don't reach the
conditional passage inside, letting it grow at will.

... which is basically what I arrived at with more investigation in my other post.

I was aware that this "set!" doesn't break the for-each, but I thought I should do let *this* loop run through to the end because in the *current* list there might be other grobs I need to process.

What I missed was that the list wasn't emptied when *no* grob matched the condition. So ironically the list grew longer with less annotations present.

What seems to fix it (at least with the one test I could do before leaving) is setting the list to an empty list in start-translation-timestep.

Still I don't feel confident about what exactly happens in what step of the process ...
Let's see how that latest change plays out.

Thanks
Urs





reply via email to

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