When breaking a system into lines, the pointers between Grobs need to
be rearranged: for example, a single Slur grob that crosses a line break is
broken into two Slur grobs, and the first Slur will point to different
notes as the second slur.
This break substitution is centrally managed, and takes an appreciable
part of the runtime.
Before this change, complicated logic is executed during the break
substitution. For example, for an Item we would determine its System
by recursively following X-parent relationships. Since each item is a
pointed to from multiple other grobs, we have to repeat this expensive
step.
This change introduces a hash map in the root System grob, mapping
(original grob, system) => broken grob. This mapping is easily
populated before the substitution, and the break substitution itself
is reduced to hash lookups.
This yields a speedup of 3-4 %.
2ea63632de - drop islive conditional.
baseline: 8343ec8810 PO: fetch Catalan from FTP
args: -I carver/ MSDM
memory: med diff 114296 (stddevs 257 240, n=3)
memory: med diff 10.7 % (2ea63632de is fatter)
time: med diff -1.39 (stddevs 0.06 0.10, n=3)
time: med diff -2.9 % (2ea63632de is faster)
2ea63632de - drop islive conditional.
baseline: 8343ec8810 PO: fetch Catalan from FTP
args: input/regression/mozart-hrn-3.ly
memory: med diff -103296 (stddevs 73 189, n=3)
memory: med diff -23.0 % (2ea63632de is leaner)
time: med diff -0.14 (stddevs 0.00 0.01, n=3)
time: med diff -4.1 % (2ea63632de is faster)
reserve mem; clear mem; c++11 loops
https://codereview.appspot.com/569740046