Page 1 of 1

Speed up MusE startup

Posted: Thu Feb 21, 2019 8:01 pm
by Basslint
Hello,

I have a fairly powerful computer but MusE takes a while to start up (~5 seconds) and to close down (~1 second). A bulkier program, Blender, takes ~3 seconds to startup.

This happens not only when MusE starts JACK but also when a JACK server is already started (maybe it's a bit faster, but not noticeably).

Is there something I can do to speed up MusE's startup? Keep in mind that I only use MusE as a MIDI editor so I don't need any of the audio editing functionalities.

Re: Speed up MusE startup

Posted: Thu Feb 21, 2019 8:16 pm
by Tim E. Real
Hello. There are command-line switches available to disable loading
of various plugin support, which can help improve loading time. Type muse3 -h to see the options.

Also if you are using the latest git version of MusE, there is now a plugin scanner which does add
considerable loading time - but only once. After the one-time scan it should be back to 'normal' speed.

Re: Speed up MusE startup

Posted: Thu Feb 21, 2019 8:27 pm
by Basslint
Tim E. Real wrote:Hello. There are command-line switches available to disable loading
of various plugin support, which can help improve loading time. Type muse3 -h to see the options.

Also if you are using the latest git version of MusE, there is now a plugin scanner which does add
considerable loading time - but only once. After the one-time scan it should be back to 'normal' speed.


Hello, I disabled all plugins and it did improve loading time. Now it's around 3 seconds when JACK is already open, and closing time is negligible, thank you. Is there something else I can do?

Re: Speed up MusE startup

Posted: Thu Feb 21, 2019 8:54 pm
by Tim E. Real
Mm, not much else I can think of.
If you are building MusE from source you can ensure that the build type
is 'Release' rather than 'Debug' which could help with speed.

Re: Speed up MusE startup

Posted: Thu Feb 21, 2019 9:07 pm
by Tim E. Real
OK If you are actually counting seconds, then there is this in main.cpp at line 1086:

Code: Select all

        // WARNING Must do it this way. Call registerClient long AFTER Jack client is created and MusE ALSA client is
        // created (in initMidiDevices), otherwise random crashes can occur within Jack <= 1.9.8. Fixed in Jack 1.9.9.  Tim.
        // This initMidiDevices will automatically initialize the midiSeq sequencer thread, but not start it - that's a bit later on.
        MusECore::initMidiDevices();
        // Wait until things have settled. One second seems OK so far.
        for(int t = 0; t < 100; ++t)
          usleep(10000);
        // Now it is safe to call registerClient.
        MusEGlobal::audioDevice->registerClient();


You uh, could remove the 'for' and 'sleep' lines, if you heed the above warning :wink:

[Edit:] Done in git master now!
No more one-second wait :)
The hack is about six years old now, was for Jack <= 1.9.8. Jack 1.9.9.5 was released Dec 10 2012.
Commented out for now. To be removed at some point if we're all good.
Try it out.