Image loading limits

As a follow up to this discussion, I ran some tests to assess the delays incurred by loading/unloading images during an experiment.

The attached experiment loads and unloads a single image stimulus 100 times and computes the average time for each operation. I ran it on PNG files of different sizes. (I also tested JPEG versions of the same images and got similar results.) The tests were run on a mid-2010 Mac Pro (2.8 GHz Quad-Core Xeon, 7200-rpm Serial ATA 3Gb/s HDD). Here are the results:

Dimensions File Size Average Load Time (ms) Average Unload Time (ms)
100x100 29K 3.5 0.1
250x250 154K 16.0 0.1
500x500 547K 65.8 0.3
750x750 1.1M 217.1 1.0
1000x1000 1.8M 269.5 1.0

With all image sizes, most of the load time is spent in the DevIL functions ilLoadImage and ilutGLBindMipmaps.

While the exact load times will depend on the images and hardware used, these results suggest that with sufficiently small images, it may be feasible to load only one image at a time, without impacting the timing of the experiment. (Unload times appear to be negligible for all image sizes.)