Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1466)

Issue 569740046: Simplify and speed up break substitution

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 months ago by hanwenn
Modified:
2 months ago
Reviewers:
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Simplify and speed up break substitution 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)

Patch Set 1 #

Patch Set 2 : reserve mem; clear mem; c++11 loops #

Unified diffs Side-by-side diffs Delta from patch set Stats (+225 lines, -132 lines) Patch
M lily/break-substitution.cc View 8 chunks +19 lines, -53 lines 0 comments Download
M lily/grob.cc View 4 chunks +23 lines, -14 lines 0 comments Download
M lily/grob-array.cc View 1 chunk +6 lines, -3 lines 0 comments Download
M lily/include/grob.hh View 3 chunks +15 lines, -4 lines 0 comments Download
M lily/include/item.hh View 1 chunk +3 lines, -1 line 0 comments Download
M lily/include/spanner.hh View 2 chunks +3 lines, -3 lines 0 comments Download
M lily/include/system.hh View 4 chunks +20 lines, -1 line 0 comments Download
M lily/item.cc View 2 chunks +29 lines, -2 lines 0 comments Download
M lily/spanner.cc View 3 chunks +7 lines, -4 lines 0 comments Download
M lily/system.cc View 1 13 chunks +100 lines, -47 lines 0 comments Download

Messages

Total messages: 1
hanwenn
2 months ago (2020-05-09 18:12:42 UTC) #1
reserve mem; clear mem; c++11 loops
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b