flucoma/flucoma-core

CepstrumF0.init() is very expensive (issue for BufPitch)

Closed this issue · 1 comments

There are a number of reasons this might get called in a buffer client as far as I can tell (setup/reset etc.) and the allocation and trig costs are high.

In a patch I have that analyses lots of chunks of audio this is the dominant cost of including pitch analysis in the process (so with it the cost is approx 530 secs and without it is approx 115 secs). Any strategies to only call this where absolutely necessary would be good. I'll try to add something where it doesn't get called if you aren't using that particular pitch algorithm and some other stuff as a PR for consideration.

A more complex (but perhaps relevant) observation is that for table type data (DCT/FFT) data can probably be shared between threads, although the model for how clients works may not allow that. It's just frustrating to suffer the cost of setting up multiple tables where it's not strictly needed.

Addressed in f6ec9be