Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

CIDetector as a Singleton #8

Merged
merged 5 commits into from
Dec 31, 2013
Merged

CIDetector as a Singleton #8

merged 5 commits into from
Dec 31, 2013

Conversation

neoplastic
Copy link
Contributor

Moved the CIDetector as a singleton as there was some overhead in the creation of new CIDetectors which Apple's Documentation recommends against.
https://developer.apple.com/library/ios/documentation/CoreImage/Reference/CIDetector_Ref/Reference/Reference.html

This should improve the performance of UIImageViews inside scroll views.

Core Image Contexts/Detectors should be initted (yes that's made up) as sparsely as possible. The reason being is each time you init one you're using GPU compute and memory. This competes with a things like UIScrollViews which are very GPU intensive.

CIDetector is still very resource hungry and I've only tested this code on an iPad Air for performance where its usable, around 40fps rather than 60fps.
options:opts];


if (!detector) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use detector == nil

croath added a commit that referenced this pull request Dec 31, 2013
@croath croath merged commit 2b13af7 into croath:master Dec 31, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants