Interactive Performance Tips?

Aside from setting inputScaleFactor and using cacheIntermediates, what are the most important things to do to get great interactive performance with Core Image (both when constructing a CIImage from URL and using CIRAWFilter). Perhaps CIImage lifetimes or how they are mutated?

Alternatively, what patterns (again other than inputScaleFactor / cacheIntermediates) most hurt performance?

Answered by Frameworks Engineer in 893522022

Maybe obvious, still worth mentioning: Reuse a single CIContext for the whole interactive session.

Maybe obvious, still worth mentioning: Reuse a single CIContext for the whole interactive session.

Keeping the CIRAWFilter object while your app is working with a given file is helpful. This is because Core Image will cache the raw sensor data in tiles for the lifetime of the image.

Also, for best performance avoid converting a RAW CIImage to a CGImageRef and passing that to your view class. It is better to have a Metal-based view and have CoreImage render directly to that.

Interactive Performance Tips?
 
 
Q