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
At first sight, the calculation of a spectrogram is something with a high potential for parallelization, since in theory the calculation of a given spectrum does not depend on that of others.
In our case, two difficulties have already been identified that disqualify straightforward parallelization:
Our track-sample reading uses a caching mechanism that assumes contiguous read of samples. For example, used this way, reading one minute of audio requires only 6 fetches to the database. Contrastingly, random reads can lead to as many fetches as there are reads (e.g. up to 1,500 reads for a 1,500 pixel-wide spectrogram)
The method CalculateOneSpectrogram is const, yet its cache holder is mutable. Calling the method concurrently can lead to undefined behavior.
Goal of this ticket is to parallelize spectrum calculations meanwhile keeping the database fetches to a minimum. This could lead to a dramatic acceleration of the spectrogram painting.
If this ticket is successful and reduces the spectrogram computation time to something almost imperceptible, beside a notable improvement in the fluidity of the spectrogram updates during playback, changing spectrogram settings could also be applied instantly, without having to press "Apply".
Activity
chinakov commentedon Dec 22, 2025
Tested, thanks!
9977 spectrogram optimizations (audacity#10034)