Menu

#5951 Calculate skylines only once.

Fixed
2020-05-08
2020-05-01
No

Before, Axis_group_interface::skyline_spacing() would call the
function add_interior_skylines(), which recursed into
VerticalAxisGroups. This caused staff-skylines to be computed twice:
once as part of the Staff's VerticalAxisGroup, and once to compute
the skyline for System.

Instead, in Axis_group_interface::skyline_spacing(), compute the
vertical-skylines for all constituent elements. Since the property is
subject to caching, the Staff skyline is only computed once.

To make this work

  • Add flags to the NoteColumn using Axis_group_interface::add_element

  • add vertical-skylines callbacks for NoteColumn and
    NoteCollision, which are also X,Y Axis groups.

  • declare add-stem-support for bass figures (or the digits are meshed
    in with stems that stick out of the staff.)

  • calculate a skyline for BassFigureAlignment, otherwise, the skyline
    is computed from the extent of the alignment, which is inaccurate if
    some bass figures have accidentals.

Formatting impact:

  • ottava-edge.ly - the ottava bracket meshes better with the stem,
    leading to tighter spacing.

Timing impact

ac49229cdf - Calculate skylines only once.
baseline: eaf40071f5 Use vectors rather than lists for skylines.
args: -I carver MSDM
memory: med diff 1916 (stddevs 103 135, n=5)
memory: med diff 0.2 % (ac49229cdf is fatter)
time: med diff -0.37 (stddevs 0.08 0.14, n=5)
time: med diff -0.8 % (ac49229cdf is faster)

https://codereview.appspot.com/553980043

Discussion

  • Han-Wen Nienhuys

     
  • Anonymous

    Anonymous - 2020-05-02

    Passes make, make check and a full make doc.

    Reg test diffs attached

     
  • Anonymous

    Anonymous - 2020-05-04
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2020-05-04

    Patch on countdown for May 6th

     
  • Anonymous

    Anonymous - 2020-05-07
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2020-05-07

    Patch counted down - please push

     
  • Jonas Hahnfeld

    Jonas Hahnfeld - 2020-05-08
    • labels: --> Fixed_2_21_2
    • status: Started --> Fixed
    • Patch: push -->
     
  • Jonas Hahnfeld

    Jonas Hahnfeld - 2020-05-08
    commit 750d6a547567409b6aa2d49bcb34912774aae4bc
    Author:     Han-Wen Nienhuys <hanwen@lilypond.org>
    AuthorDate: Sun Apr 26 15:39:01 2020 +0200
    Commit:     Han-Wen Nienhuys <hanwen@lilypond.org>
    CommitDate: Fri May 8 09:14:16 2020 +0200
    
        Calculate skylines only once.
    
        Before, Axis_group_interface::skyline_spacing() would call the
        function add_interior_skylines(), which recursed into
        VerticalAxisGroups.  This caused staff-skylines to be computed twice:
        once as part of the Staff's VerticalAxisGroup, and once to compute
        the skyline for System.
    
        Instead, in Axis_group_interface::skyline_spacing(), compute the
        vertical-skylines for all constituent elements.  Since the property is
        subject to caching, the Staff skyline is only computed once.
    
        To make this work
    
        * Add flags to the NoteColumn using Axis_group_interface::add_element
    
        * add vertical-skylines callbacks for NoteColumn and
          NoteCollision, which are also X,Y Axis groups.
    
        * declare add-stem-support for bass figures (or the digits are meshed
          in with stems that stick out of the staff.)
    
        * calculate a skyline for BassFigureAlignment, otherwise, the skyline
          is computed from the extent of the alignment, which is inaccurate if
          some bass figures have accidentals.
    
        Formatting impact:
    
        * ottava-edge.ly - the ottava bracket meshes better with the stem,
          leading to tighter spacing.
    
        Timing impact
    
        ac49229cdf - Calculate skylines only once.
          baseline: eaf40071f5 Use vectors rather than lists for skylines.
          args: -I carver MSDM
          memory: med diff 1916 (stddevs 103 135, n=5)
          memory: med diff 0.2 % (ac49229cdf is fatter)
          time: med diff -0.37 (stddevs 0.08 0.14, n=5)
          time: med diff -0.8 % (ac49229cdf is faster)
    
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.