-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPU intensity of resampling #239
Comments
Bump…. any feedback on this issue? |
Hey Geoff, I don't think there's a better way to handle resampling—your code looks good. The speed seems reasonable given the amount of data and the 2.7 GHz CPU. The number of cores doesn't matter here because resampling uses a single thread. Just ensure that you're using release (optimized) build and avx2 is enabled (or multiarch). Can you please post the output of |
Hey Dan, Thanks for your response. library_version() produced KFR 6.0.4 debug avx2 64-bit (clang-15.0.0/macos) +in +ve I was building for Debug. Changing Xcode Scheme to Release build and it now consumes less than 4 seconds CPU. An order of magnitude faster! I have the -Os and -mavx2 options set in Xcode for both Debug and Release builds. Looks like mavx2 is in effect. Do I need to specify any #define in my C++ program for further optimisation? I don't need multi-architecture. Reason for my interest in performance of this feature is that I'm resampling (and applying filtering) at playback time. I appreciate your help. Fantastic library BTW - great work. Cheers, |
Multiarchitecture is controlled by |
Hey Dan,
I have a question about resampling, as it seems to be expensive in terms of CPU.
Declarations:
univector audio_resampled(2229);
univector audio(2048);
samplerate_converter resampler = samplerate_converter(resample_quality::draft, 48000, 44100);
For each chunk of 2048 samples:
resampler.process(audio_resampled, audio);
This consumes approx. 40 sec CPU to process 4.9 million samples, on my 2018 Mac Mini (2.7GHz Core i5 with 6 cores). Is there are less CPU intensive way to do this?
Appreciate your help.
Thanks in advance,
Geoff.
The text was updated successfully, but these errors were encountered: