You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some profiling with Valgrind and it turns out that the loading of files and the import of MIDI files is slowed down by the creation of DetuneHelper in Note.
You can test the impact of the code for file loading as follows:
Compile a vanilla version from master.
Start LMMS and load the file DnB.mmpz from the Demos folder.
Close LMMS.
Comment out the calls to createDetuning in Note::Note and Note::loadSettings.
The main problem with createDetuning seems to be the sheer number of DetuningHelpers that are created during the load/import. Even though they are created using the MemoryPool their creation still slows the code down significantly. It's very likely that this problem can only be alleviated by changing the design. Does every note really need its own DetuningHelper? Is it possible to keep the DetuningHelper as an aggregate in Note and not as a pointer?
The text was updated successfully, but these errors were encountered:
Does every note really need its own DetuningHelper?
I don't think so. You could pass the same empty DetuningHelper to all the Notes. Then you'd need to add a way to swap in another somehow, I don't think there is one now. Or maybe allow Notes with no DetuningHelper, which could mean adding checks for null pointers in a lot of places and potential bugs.
Is it possible to keep the DetuningHelper as an aggregate in Note and not as a pointer?
Would that be faster? There'd still be a pointer to an AutomationPattern down in InlineAutomation if I'm reading this right.
I did some profiling with Valgrind and it turns out that the loading of files and the import of MIDI files is slowed down by the creation of
DetuneHelper
inNote
.You can test the impact of the code for file loading as follows:
DnB.mmpz
from the Demos folder.createDetuning
inNote::Note
andNote::loadSettings
.DnB.mmpz
from the Demos folder again.The impact for MIDI import can be tested in a similar fashion. You only have to import a MIDI file instead of loading an LMMS file. An example MIDI file can be found at http://www.eurokdj.com/ringtones/midi_files/Twenty_4_Seven-Take_Me_Away.mid. (Please refer to #1971 for other source for MIDI files).
The main problem with
createDetuning
seems to be the sheer number ofDetuningHelpers
that are created during the load/import. Even though they are created using theMemoryPool
their creation still slows the code down significantly. It's very likely that this problem can only be alleviated by changing the design. Does every note really need its ownDetuningHelper
? Is it possible to keep theDetuningHelper
as an aggregate inNote
and not as a pointer?The text was updated successfully, but these errors were encountered: