Hi Yoshimi-developers,

to summarise the results of my extended investigation:

 * the shiny new features have their price tag, unfortunately.
 * however, the legacy mode is not affected, and even slightly faster


What is the reason?
As it turns out, it is the mere fact *that* we're computing something
concurrently and passing data between threads. This is even more surprising,
as the test itself and the measurements run completely within a single thread.
Just the mere fact that data has been computed within another thread and handed
over between threads is enough to slowdown following computations significantly.

And this effect can be quite stark.
The most extreme test case I've investigated computes a single 100ms note.
To reiterate: the PADsynth is configured beforehand and the new wavetable
is built and installed completely /before/ starting the time measurement.

Averaged times (20 Test runs each):

- old code: 0.5137ms
- concurrent: 1.3588ms
- Legacy mode: 0.5064ms

The statistical fluctuation is...
  ± 3σ = 0.03ms (for old code and Legacy mode)
  ± 3σ = 1.05ms (for the new code in concurrent mode)

As you see, this is a drastic effect. The reworked code takes on
average 3 times as long, and there is much more spread in the values,
which sometimes even go up beyond 2ms. However, to put that into context,
in these 2ms we're computing sample data worth 100ms of playing time.

And on longer notes or extended sequences of shorter notes, the effect wanes.
A 10s note takes only 1.1 times the computing time, and similar for an extended
sequence of short notes.


To conclude: if we go ahead with this feature, computing PADSynth got slightly
more expensive. In typical usage, I'd expect that effect to be not noticeable;
however there will be corner cases, and some usage patterns might be affected.
In those cases however we can recommend to switch to the Legacy mode, where
PADSynth is still muted as before and the wavetable is rebuilt blockingly.

-- Hermann







_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to