I measured encoding speed of 24-bit WAV files. It turns out that 32-bit encoder made by GCC is ~1.7x times slower than 32-bit encoder made by MSVS. It seems that GCC creates inefficient code for 32bit * 32bit -> 64bit multiplication for 32-bit architecture. This problem affects FLAC__lpc_compute_residual_from_qlp_coefficients_wide() and FLAC__lpc_restore_signal_wide() functions. Is there any way to fix this (apart from rewriting these 2 functions in 32-bit asm) ?
On 22-09-13 10:31, lvqcl wrote:> I measured encoding speed of 24-bit WAV files. It turns out that 32-bit > encoder made by GCC is ~1.7x times slower than 32-bit encoder made by MSVS.Strange, I'm not able to reproduce your findings. I did found something rather odd though. I thought MSVC, ICL and GCC would produce the same files, but for some reason a GCC compile creates slightly smaller files. Looks like there is some GCC-specific code that influences compression ratio? I haven't noticed that in any of the tests I did before. GCC is a bit slower, but nowhere near 1.7x Results are here: http://www.icer.nl/misc_stuff/compare-24-bit-speed-across-compiles.pdf These results are from an MinGW compile (GCC 4.6.1 AFAIK), MSVC 2012 and ICL 13 compiles of FLAC 1.3.0 without any modifications. These are all 32-bit executables run on a 64-bit Windows 7 system. The graphs show encoding and decoding performance on Lord of the Rings: The Two Towers (The Complete Recordings) in 44/16 and 48/24, and Nine Inch Nails' The Slip in 44/16 and 96/24. See the graph titles. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20130922/65703767/attachment.htm
Martijn van Beurden <mvanb1 at gmail.com> ?????(?) ? ????? ?????? Sun, 22 Sep 2013 14:45:31 +0400:> On 22-09-13 10:31, lvqcl wrote: >> I measured encoding speed of 24-bit WAV files. It turns out that 32-bit >> encoder made by GCC is ~1.7x times slower than 32-bit encoder made by MSVS. > > Strange, I'm not able to reproduce your findings. I did found something > rather odd though. I thought MSVC, ICL and GCC would produce the same > files, but for some reason a GCC compile creates slightly smaller files. > Looks like there is some GCC-specific code that influences compression > ratio? I haven't noticed that in any of the tests I did before. GCC is a > bit slower, but nowhere near 1.7xSorry I forgot to mention that I tested only -8 preset as the most CPU intensive. Input file is 44.1/24/stereo, test CPU is Core2 Q9300. Tested FLAC encoders: * 32-bit from Rarewares * 64-bit from Rarewares * 32-bit from http://www.saunalahti.fi/~cse/temp/flac-1.3.0-win32.zip * 32-bit from http://www.icer.nl/misc_stuff/flac-1.3.0-final-minGW.zip I also downloaded MSYS-MinGW 4.8.1 from http://xhmikosr.1f0.de/tools/ and compiled 32-bit and 64-bit versions of FLAC 1.3.0 myself. Encoding time, in seconds, for 64-bit builds: rarewares: 84.9 s (ICL) my compile: 90.9 s (MinGW 4.8.1) for 32-bit builds: rarewares: 137.5 s (ICL) saunalahti: 120.9 s (MSVS 2012) icer.nl: 204.8 s (MinGW) my compile: 234.4 s (MinGW 4.8.1) 234.4/120.9 = 1.94 and 204.8/137.5 = 1.49, and 1.7 is somwhere between these ratios.