Large performance regression of MIDI output on lyrics and marks
The Carver MSDM score (attached) usually compiles in roughly 20s on my machine. With current master, compiled with Guile 2 and using byte-compilation, it takes four times as much. This appears caused by commit d0a835ef, adding the Mark_performer
. Profiling with statprof (https://www.gnu.org/software/guile/manual/html_node/Statprof.html) shows that the additional time is spent in markup->string
. Apparently, this function is now called on every lyric word. I don't know if that is intentional or not. At any rate, the problem can also be reproduced more simply with
\version "2.23.6"
\score {
\repeat unfold 200 { \mark \default c'1 }
\midi {
\context {
\Score
% \remove Mark_performer
}
}
}
With released 2.23.5, this takes around 0.3s. With master, more like 3s. Uncommenting \remove Mark_performer
brings the time back to normal.
It would appear that markup->string
walks around the entire set of bindings of the lily
module at every invocation. Also, it uses primitive-eval
on a large list, which can be slow under Guile 2.
Tentatively marking Critical.
CC @eble