GPUImage3
GPUImage3 copied to clipboard
CPU & Memory usage exceed than GPUImage2 ?
Hello there!
I try to compare the CPU & Memory usage between GPUImage2
and GPUImage3
on filters group, my device is iPhone XR in HongKong, iOS system is 12.1.4. Here is my code:
var videoCamera:GPUImageVideoCamera?
var filter1 = GPUImageLuminanceThresholdFilter()
let filter2 = GPUImagePixellateFilter()
let filter3 = GPUImagePolarPixellateFilter()
let filter4 = GPUImageAmatorkaFilter()
override func viewDidLoad() {
super.viewDidLoad()
videoCamera = GPUImageVideoCamera(sessionPreset: AVCaptureSession.Preset.high.rawValue, cameraPosition: .back)
videoCamera!.outputImageOrientation = .portrait;
videoCamera?.addTarget(filter1)
filter1.addTarget(filter2)
filter2.addTarget(filter3)
filter3.addTarget(filter4)
filter4.addTarget(self.view as! GPUImageView)
videoCamera?.startCapture()
}
On GPUImage2
the CPU usage between 16% ~ 20%, Memory usage between 90 - 100 MB.
On GPUImage3
the CPU usage between 46% ~ 52%, Memory usage between 190 - 200 MB.
Why GPUImage3
performance worst than GPUImage2
?
GPUImage 3 is still just getting built out, so we don't have the same optimizations in place that I did in GPUImage 2. This is especially true about the inputs and outputs, and I'm pretty sure something's wrong in the current camera setup.
We still have a lot of work to do on the inputs and outputs to get this to be ready for regular use.
Thank u for your reply, and could u provide some optimization ideas ?