13
0

Don't call MidiPatchManager::refresh when creating MidiPatchManager instance

Currently when loading a session for the first time MidiPatchManager::instance
creates the MidiPatchManager singleton which calls MPM::refresh and all the
midnam files are parsed etc. MPM::set_session is then immediately called and
all the MPM state that has just been set when parsing all the midnam files is
cleared and the parsing of all the files is performed again but this time with
any session specific midnam patch files.

MPM::instance and MPM::set_session consume about 55% of the time spent in the
Session ctor according to kcachegrind and removing the double call to refresh
brings Session construction time for a particular test session down from 7.5s
to 5.5s
This commit is contained in:
Tim Mayberry 2015-10-19 08:42:28 +10:00 committed by Paul Davis
parent 3c4f899a4f
commit 9fd75e33fe

View File

@ -43,7 +43,6 @@ MidiPatchManager* MidiPatchManager::_manager = 0;
MidiPatchManager::MidiPatchManager ()
{
refresh ();
}
void