looking at the code for MidiSystem.getSequencer() it looks like it tries to connect various things trying to connect the next one if the previous one fails. This means that if all connection attempts fail down to the last it could take a lot of time.
To test this theory try using
Sequencer sequencer = MidiSystem.getSequencer(false);
and see if that line executes any faster, if it does then the issue is the time taken to connect to the default synthesizer.
when calling getSequencer() the series of events are
- obtain default Sequencer connected to default device
- returned Sequencer is connected to default Synthesizer...
- if there is no Synthesizer available or default cannot be opened connect to default Receiver. The connection is made by getting a Transmitter instance from Sequencer and setting it's Receiver.
This text is almost verbatim what is in the javadoc but as you can see there is enough attempting to create connections to make the call a bit slow.