Improve performance when moving channels in the Mixer#8235
Open
sakertooth wants to merge 4 commits intoLMMS:masterfrom
Open
Improve performance when moving channels in the Mixer#8235sakertooth wants to merge 4 commits intoLMMS:masterfrom
sakertooth wants to merge 4 commits intoLMMS:masterfrom
Conversation
Contributor
Author
|
Removing the channels is still somewhat slow it seems, probably because we are still deallocating the effect views on destruction. |
|
I tested this (Linux, X11), and moving channels is now basically instant, which is nice. Didn't test the demos because it seems I am a professional idiot who cannot find them, so instead I loaded up some projects with many mixers channels. |
This PR gave rise to issues elsewhere in the mixer code. This fixes a deadlock when moving channels rapidly by always locking and unlocking the same channel on calls to `Mixer::mixToChannel`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moving channels in Mixer originally updated the necessary
MixerChannelView's to point to the new models as well as update the channel number. This caused bad performance specifically with updating theEffectRackViewmodel, as newEffectView's have to be allocated and deallocated for each channel, causing the slowdown.EffectViewis quite expensive to allocate. Removing channels also seemed to have the same performance issue (it is more noticeable when VSTs are in use).This fixes things by only updating the channel indices and swapping the channel within the layout for a move operation, and simply updating the channel indices when removing channels for a remove operation (this change is still applied in regards to removal of the channels, but it doesn't seem to improve the performance that much).
Note to testers: Ensure that there are no regressions or odd behavior (missing updates to the effect rack/channel or something) when moving and/or deleting channels. Testing the various demos would be good.
General note: This also seems to fix an issue where the VST effect windows would open when moving mixer channels as new ones are not being created on the fly anymore.