-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
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
inNote::Note
andNote::loadSettings
. - Recompile and start LMMS again.
- Load
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 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?