I often find myself wanting to create > 1000 Jp2k objects, which will then be distributed across multiple cores where the image data is actually read in. This is relatively fast on my local hard drive, but on an external drive it gets a factor of ~10 slower. Doing some quick profiling of creating 1275 Jp2k objects stored on an external SSD reveals performance could be improved by making sure that the Jp2k constructor only opens the file once; currently it opens the file twice. These are total times in seconds spent on each line of code:
I often find myself wanting to create > 1000 Jp2k objects, which will then be distributed across multiple cores where the image data is actually read in. This is relatively fast on my local hard drive, but on an external drive it gets a factor of ~10 slower. Doing some quick profiling of creating 1275 Jp2k objects stored on an external SSD reveals performance could be improved by making sure that the Jp2k constructor only opens the file once; currently it opens the file twice. These are total times in seconds spent on each line of code: