[flac-dev] Again about encoding speed of different compiles

lvqcl lvqcl.mail at gmail.com
Fri Oct 4 11:33:01 PDT 2013


I downloaded current version of FLAC sources and compiled it with:
* GCC 4.8.1 (MSYS from http://xhmikosr.1f0.de/tools/)
* Intel C++ Composer XE 2013 update 5
* MSVS 2010 SP1
* MSVS 2012 update 3
(SSSE3 and SSE4.1 code was disabled for all compilers)

Stereo 24-bit WAV file was encoded with -8 preset.

Encoding time, in seconds:
GCC  32-bit: 209
ICC  32-bit: 130
VS10 32-bit: 116
VS12 32-bit: 114

GCC  64-bit: 79.5
ICC  64-bit: 81.2
VS10 64-bit: 81.1
VS12 64-bit: 83.3

According to a profiler, FLAC__lpc_compute_residual_from_qlp_coefficients_wide()
is one of the most CPU consuming. I added __restrict keyword to its parameters.
before it was:
void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data,
     unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order,
     int lp_quantization, FLAC__int32 residual[])
after:
void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * __restrict data,
     unsigned data_len, const FLAC__int32 * __restrict qlp_coeff, unsigned order,
     int lp_quantization, FLAC__int32 * __restrict residual)

Encoding time, in seconds:
GCC  32-bit: 180 (16% speedup)
ICC  32-bit: 121 (7.5%)
VS10 32-bit: 439 (sic!)
VS12 32-bit: 440 (sic!)

GCC  64-bit: 72.8 (9%)
ICC  64-bit: 75.0 (8%)
VS10 64-bit: 75.7 (7%)
VS12 64-bit: 77.7 (7%)


Also I wonder what other functions can also benefit from `restrict' keyword?..


More information about the flac-dev mailing list