Replace static PBD::Signal in NoteBase with direct call to MidiRegionView
authorTim Mayberry <mojofunk@gmail.com>
Wed, 14 Oct 2015 10:37:07 +0000 (20:37 +1000)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 18 Oct 2015 02:15:07 +0000 (22:15 -0400)
commite7b8e98db26bc2b9ee2587f388de2dbbf7ca5837
tree227714e6850ccbabd534d46aff1530f9b83bcbb2
parent827c23bef3a8ccc102895f55b7632074241f9684
Replace static PBD::Signal in NoteBase with direct call to MidiRegionView

NoteBaseDeleted signal is static so each MidiRegionView(MRV) gets notified
about the deletion of each NodeBase instance even if it is contained in another
MRV

The NoteBase and MRV classes are currently coupled anyway, so this change uses
the reference to the MRV parent to directly call the parent when the NoteBase
is deleted. This is all in the GUI thread so I'm not sure why a PBD::Signal was
being used?

If the MRV class is the only reference holder to the NoteBase class
then I'm not sure if a callback is needed, perhaps the MRV should just remove
the note from the selection before deleting it but I'm not that familiar with
the code.

Signal emission/calls static NoteBaseDeleted signal vs direct with 10540
NoteBase instances.

static:

After Load Session: 6360638
After Unload Session: 12221026(5860388)

direct:

After load Session: 10540
After unload Session: 21080

Session Load/Unload time in master, debug/release with ~10000 Notes(seconds)

Load Debug: 32, 26
Unload Debug: 83
Load Release 32, 20, 42
Unload Release 26, 25

Session Load/Unload time with direct call debug/release(seconds)

Load Debug: 21.7, 18.1
Unload Debug: 69.4, 71
Load Release: 22.6, 13.4, 17.7
Unload Release: 24, 23.5

This is not a large Session, 1500 regions, 10000 notes so there is probably
some other funky stuff going on that needs fixing.
gtk2_ardour/midi_region_view.cc
gtk2_ardour/midi_region_view.h
gtk2_ardour/note_base.cc
gtk2_ardour/note_base.h