I went from C++ to C for performance but to be honest I'm not sure if it was a good choice. Here are some points to consider switching back:
Positive
More portable threading, easier to use and understand (no structs and etc), std::atomic<global_status_t> for global status variable (could even make it a bit faster, but probably unnoticeable).
Better standard library and more flexibility: vectors, stoi instead of hardcoding MAX_SECONDS_STR, avoiding strcat, strcpy etc (in linux_download.c).
Constexpr instead of macros (much safer).
Negative
Worse performance? -> has to be tested with benchmarks and godbolt
Other ideas:
Maybe only parts of the code in C for performance (cross_correlation.c). Otherwise, the FFTW C++ bindings could be used https://github.com/dealias/fftwpp.
Depends on what other libraries I end up using, and what languages they are available for.
I think it's going to be easier to just use C. Both PulseAudio and libav are in C, so using bindings for everything will over-complicate the code IMO. C it is, for now.
I went from C++ to C for performance but to be honest I'm not sure if it was a good choice. Here are some points to consider switching back:
Positive
std::atomic<global_status_t>
for global status variable (could even make it a bit faster, but probably unnoticeable).stoi
instead of hardcodingMAX_SECONDS_STR
, avoidingstrcat
,strcpy
etc (inlinux_download.c
).Negative
Other ideas: