Skip to content

Improve performance when moving channels in the Mixer#8235

Open
sakertooth wants to merge 4 commits intoLMMS:masterfrom
sakertooth:improve-mixer-view-performance
Open

Improve performance when moving channels in the Mixer#8235
sakertooth wants to merge 4 commits intoLMMS:masterfrom
sakertooth:improve-mixer-view-performance

Conversation

@sakertooth
Copy link
Contributor

@sakertooth sakertooth commented Jan 28, 2026

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 the EffectRackView model, as new EffectView's have to be allocated and deallocated for each channel, causing the slowdown. EffectView is 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.

@sakertooth
Copy link
Contributor Author

Removing the channels is still somewhat slow it seems, probably because we are still deallocating the effect views on destruction.

@sakertooth sakertooth changed the title Improve performance when moving and removing channels in the Mixer Improve performance when moving channels in the Mixer Jan 28, 2026
@CorruptVoidSoul
Copy link

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.
Nothing went wrong, going from channels with effects that have peak controllers on them or directly modifying their effects, to channels with VSTs on them. Neat !

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`
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.

2 participants