trevorbaca / baca

Trevor Bača's Abjad library.
8 stars 3 forks source link

Optimize segment-maker against récursif segments #4

Closed trevorbaca closed 6 years ago

trevorbaca commented 6 years ago

Total runtime of 4 + 6 = 54 (!) seconds doesn't make sense:

Interpreting recursif/segments/E/layout.py ...
Writing recursif/segments/E/__make_layout_ly__.py ...
Interpreting recursif/segments/E/__make_layout_ly__.py ...
No breaks in recursif/segments/E/__make_layout_ly__.py ...
Removing recursif/segments/E/__make_layout_ly__.py ...
Making segment E PDF ...
Removing recursif/segments/E/illustration.ly ...
Removing recursif/segments/E/illustration.pdf ...
Writing recursif/segments/E/__make_segment_pdf__.py ...
Interpreting recursif/segments/E/__make_segment_pdf__.py ...
 Running segment-maker ...
  Found 64 rhythm commands ...
  Rhythm command time 4 seconds ...
  Found 128 nonrhythm commands ...
  Nonrhythm command time 6 seconds ...
 Segment-maker runtime 54 seconds ...
 Abjad format time 2 seconds ...
 Wrote 16 measures to recursif/segments/E/illustration.ly ...
 Handling edition tags ...
  Found 1 other-edition tag ...
  Deactivating 1 other-edition tag ...
  Found 257 this-edition tags ...
  Activating 1 this-edition tag ...
  Skipping 256 (active) this-edition tags ...
 Ignoring empty recursif/segments/E/layout.py ...
 Running LilyPond ...
 LilyPond runtime 4 seconds ...
Found recursif/segments/E/illustration.ly ...
Found recursif/segments/E/illustration.pdf ...
Removing recursif/segments/E/__make_segment_pdf__.py ...
trevorbaca commented 6 years ago

Note offsets-in-seconds update (source: Component._update_now(offsets_in_seconds=True)):

Making segment E PDF ...
Removing recursif/segments/E/illustration.ly ...
Removing recursif/segments/E/illustration.pdf ...
Writing recursif/segments/E/__make_segment_pdf__.py ...
Interpreting recursif/segments/E/__make_segment_pdf__.py ...
 Running segment-maker ...
  Score initialization 0 seconds ...
  Rhythm commands 5 seconds [for 64 commands] ...
  After-rhythm commands 2 seconds ...
  Nonrhythm commands 7 seconds [for 128 commands] ...
  Postprocessing 11 seconds ...
  Offsets-in-seconds update 24 seconds ...
  Clocktime markup 0 seconds ...
 Segment-maker runtime 50 seconds ...
 Abjad format time 2 seconds ...
 Wrote 16 measures to recursif/segments/E/illustration.ly ...
 Handling edition tags ...
  Found 1 other-edition tag ...
  Deactivating 1 other-edition tag ...
  Found 257 this-edition tags ...
  Activating 1 this-edition tag ...
  Skipping 256 (active) this-edition tags ...
 Ignoring empty recursif/segments/E/layout.py ...
 Running LilyPond ...
 LilyPond runtime 4 seconds ...
Found recursif/segments/E/illustration.ly ...
Found recursif/segments/E/illustration.pdf ...
Removing recursif/segments/E/__make_segment_pdf__.py ...
trevorbaca commented 6 years ago

Interpretation time reduced from 54 seconds to 28 seconds with update manager optimization:

Making segment E PDF ...
Removing recursif/segments/E/illustration.ly ...
Removing recursif/segments/E/illustration.pdf ...
Writing recursif/segments/E/__make_segment_pdf__.py ...
Interpreting recursif/segments/E/__make_segment_pdf__.py ...
 Running segment-maker ...
  Score initialization 0 seconds ...
  Rhythm commands 5 seconds [for 64 commands] ...
  After-rhythm commands 2 seconds ...
  Nonrhythm commands 7 seconds [for 128 commands] ...
  Postprocessing 11 seconds ...
  Offsets-in-seconds update 2 seconds ...
  Clocktime markup 0 seconds ...
 Segment-maker runtime 28 seconds ...
 Abjad format time 2 seconds ...
 Wrote 16 measures to recursif/segments/E/illustration.ly ...
 Handling edition tags ...
  Found 1 other-edition tag ...
  Deactivating 1 other-edition tag ...
  Found 257 this-edition tags ...
  Activating 1 this-edition tag ...
  Skipping 256 (active) this-edition tags ...
 Ignoring empty recursif/segments/E/layout.py ...
 Running LilyPond ...
 LilyPond runtime 4 seconds ...
Found recursif/segments/E/illustration.ly ...
Found recursif/segments/E/illustration.pdf ...
Removing recursif/segments/E/__make_segment_pdf__.py ...