This is an old revision of the document!

Read Speed Test

The following terminal output shows the difference in processing requirements for 24bit and 32bit wav files when loading from the disk. This is a strong indicator that we should ALWAYS keep our wav files in 32bit on disk to enhance disk streaming.

  time ./test.out test24bit.wav
  real	0m13.421s
  user	0m9.944s
  sys	0m3.464s

  time ./test.out test32bit.wav
  real	0m4.410s
  user	0m0.376s
  sys	0m4.028s

The code:

#include <sndfile.h>
#define N 100
int main(int argc, char*argv[])
        for(int n = 0; n < N; ++n)
                SF_INFO sf_info;
                SNDFILE *fh = sf_open(argv[1], SFM_READ, &sf_info);
                float samples[1024];
                        sf_count_t r = sf_read_float(fh, samples, 1024);
                        if(r < 1024) break;
        return 1;

The files used were ~200MB

speed_test.1490126662.txt.gz ยท Last modified: 2017/03/21 21:04 by deva
Trace: speed_test
GNU Free Documentation License 1.3
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0