Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move midi initialisation to a thread #5839

Merged
merged 3 commits into from
Jun 13, 2023
Merged

Conversation

peppy
Copy link
Member

@peppy peppy commented Jun 13, 2023

MIDI is rarely used. On top of that, on macOS the overhead on first call to the Devices enum is very expensive (>1s). This shouldn't delay startup of the game.

JetBrains Rider 2023-06-13 at 06 18 12

Implementation is copied from OpenTabletDriveHandler, which should be quite reliable.

MIDI is rarely used. On top of that, on macOS the overhead on first
 call to the `Devices` enum is very expensive (>1s). This shouldn't
delay startup of the game.

Implementation is copied from `OpenTabletDriveHandler`, which should
be quite reliable.
@smoogipoo
Copy link
Contributor

Is the return refreshDevices() not also relevant here?

@peppy
Copy link
Member Author

peppy commented Jun 13, 2023

Hold off, this is really dodgy.

@peppy
Copy link
Member Author

peppy commented Jun 13, 2023

Is the return refreshDevices() not also relevant here?

yes.

@peppy
Copy link
Member Author

peppy commented Jun 13, 2023

After 06d630b:

JetBrains Rider 2023-06-13 at 06 37 43

Both profile sessions are over 10 seconds, which gives enough time for refreshDevices to re-run many times.

@smoogipoo smoogipoo merged commit 0be2ba9 into ppy:master Jun 13, 2023
@peppy peppy deleted the threaded-midi-init branch June 21, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants