Are you going through the images sequentially? Does your app have any knowledge about when it will not need a file for a while? Or is it truly unpredictable random access?
Can you explain a little bit more about the access pattern? Are you often just checking attributes, or are you accessing pixels? Also, which platform? > On Apr 11, 2016, at 4:05 PM, Jonathan Tilden (2K) <[email protected]> > wrote: > > Hi all! > > We're running into an issue where we are seeing a great decrease in > performance when opening 1000s (23,317, specifically) of files with image > buffers in Python. > Initially, each image is very fast (many per second), but as time goes it, > the perf drops to < 1 image/sec. > > Our problem is that we were looking at dds files to pull out the compression > (using the "compression" attribute on the image spec). Suspecting it was > maybe an issue with dds io, we just switched to more generic images, with a > more generic attribute query: > > import OpenImageIO as oiio > > def get_resolution_from_attr(file): > """Getting the resolution from an attribute. Yes there are better ways > to get resolution :)""" > buf = oiio.ImageBuf(file) > spec = buf.spec() > xres = spec.get_attribute('XResolution') > yres = spec.get_attribute('YResolution') > buf.clear() # Didn't seem to make much of a difference > return file, xres, yres > > Before we get all deep with the debugger - is there anything obvious that > we're doing here that might cause the gradual slowdown of the image buffers? > Not using image buffers isn't much of an option for us as we need to do some > image-buffery stuff with them later. > > Thanks! > -J > -- Larry Gritz [email protected] _______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
