Remove unused volume model in SamplePlayHandle#8349
Merged
sakertooth merged 2 commits intoLMMS:masterfrom Apr 21, 2026
Merged
Conversation
Contributor
Author
Fixed in #8350. |
rubiefawn
approved these changes
Apr 20, 2026
Contributor
rubiefawn
left a comment
There was a problem hiding this comment.
LGTM. I'd suggest using NSDMI for some of the members of SamplePlayHandle (coding conventions) but that's non-blocking.
Contributor
Author
Great. And will get around to doing that eventually. |
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.
Removes the unused volume model in
SamplePlayHandle, as allocating this was causing performance issues under extreme conditions (see #8348). Profiling showed a performance bottleneck inlmms::ProjectJournal::allocID, which creates a new journaling ID for the model.Given that this was called so rapidly, its likely that the map filled very quickly (
fastRandonly has a range of 32,767 values) and over time,tidkept incrementing for longer and longer periods of time, taking up CPU cycles.Here is the backtrace as well:
Couple of points:
SamplePlayHandleobjects (when not allocated from aSampleClip*but a path to a sample) lead to decoding the audio file repetitively on the audio thread. This problem is currently only seen with the metronome (and theoretically also tap tempo).SamplePlayHandleobject directly without performance headaches. Currently, we can't and don't do that anyways (e.g., clips and their volume are handled viaAudioBusHandle, which has a pointer to the volume model contained within the track) so this unused volume model was causing more problems than anything else.Fixes #8348.