title: What is the fastest way to read a sequence of images?
body: <p>I have a speed critical program that will repeatedly <em>reads</em> images from disk and compute values from them. The images are too many to store in memory. </p>
  
  <p>The same set of images will be read, we will not change/edit them, and their order is fix. </p>
  
  <p>Not all the images have the same size, but they all have roughly 1 Mb when encoded as PNG. There are tens of thousands of them and most of the RAM is already used to store the computed values.</p>
  
  <blockquote>
    <p>Other than buying faster disks, or using RAID, what is the fastest way to read a sequence of images ?</p>
  </blockquote>
  
  <p>Would it be faster to have them all inside a large tar file (and read them with custom untaring code), instead of as individual files in a folder ?</p>
  
  <p>I could not find a multi-threaded implementation of PNG decoding, so this stage may also become a bottleneck. Would using WebP instead of PNG provide an additional speed edge ?</p>
  
  <p>Which other ideas should I consider/evaluate ?</p>