Skip to content

Instantly share code, notes, and snippets.

@andrewrabert
Created March 17, 2026 03:04
Show Gist options
  • Select an option

  • Save andrewrabert/4e3949b0ddbe565395d8fb27aef66cdf to your computer and use it in GitHub Desktop.

Select an option

Save andrewrabert/4e3949b0ddbe565395d8fb27aef66cdf to your computer and use it in GitHub Desktop.
benchmarking flac and CFLAGS

benchmarking flac and CFLAGS

$ reencode-lossless .
( 1/13) ------- 06 - Fatamorgana.flac
( 2/13) ------- 13 - Set Me Free.flac
( 3/13) ------- 12 - Carpe Diem.flac
( 4/13) ------- 08 - Information Society.flac
( 5/13) ------- 11 - High on Pain.flac
( 6/13) ------- 09 - No Shuffle.flac
( 7/13) ------- 01 - Game of Life.flac
( 8/13) ------- 10 - Ready to Go.flac
( 9/13) ------- 04 - Digital Citizens.flac
(10/13) ------- 02 - Feeding the Flames.flac
(11/13) ------- 03 - Conflict.flac
(12/13) ------- 07 - No Future.flac
(13/13) ------- 05 - Legacy.flac
Total: -

Default (package from extra)

$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.581 s ±  0.022 s    [User: 20.057 s, System: 0.835 s]
  Range (min … max):    1.546 s …  1.615 s    10 runs

-O3

$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.301 s ±  0.019 s    [User: 16.506 s, System: 0.876 s]
  Range (min … max):    1.267 s …  1.324 s    10 runs
 
$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.306 s ±  0.023 s    [User: 16.574 s, System: 0.875 s]
  Range (min … max):    1.262 s …  1.336 s    10 runs

-march=x86-64-v3 -O3

$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.256 s ±  0.023 s    [User: 15.629 s, System: 0.888 s]
  Range (min … max):    1.228 s …  1.300 s    10 runs
 
$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.255 s ±  0.014 s    [User: 15.658 s, System: 0.861 s]
  Range (min … max):    1.239 s …  1.281 s    10 runs

-march=native -O3 (AMD 3950X)

$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.258 s ±  0.035 s    [User: 15.660 s, System: 0.875 s]
  Range (min … max):    1.222 s …  1.349 s    10 runs
 
$ hyperfine -n 5 'reencode-lossless .'
Benchmark 1: 5
  Time (mean ± σ):      1.261 s ±  0.046 s    [User: 15.686 s, System: 0.884 s]
  Range (min … max):    1.231 s …  1.385 s    10 runs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment