Skip to content

CPU & Memory usage exceed than GPUImage2 ? #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dito010 opened this issue Feb 27, 2019 · 2 comments
Open

CPU & Memory usage exceed than GPUImage2 ? #34

dito010 opened this issue Feb 27, 2019 · 2 comments

Comments

@dito010
Copy link

dito010 commented Feb 27, 2019

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 ?

@dito010 dito010 changed the title CPU usage exceed than GPUImage2 CPU & Memory usage exceed than GPUImage2 ? Feb 27, 2019
@BradLarson
Copy link
Owner

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.

@dito010
Copy link
Author

dito010 commented Feb 28, 2019

Thank u for your reply, and could u provide some optimization ideas ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants