Significant UIGestureRecognizer performance regression in iOS 9

Originator:green
Number:rdar://24648352 Date Originated:14-Feb-2016
Status:Duplicate Resolved:
Product:iOS SDK Product Version:9.1 - 9.3 Beta 1
Classification:Performance Reproducible:Always
 
Summary:
Adding a failure dependency to a gesture recognizer is about 40x slower in iOS 9 than it was in iOS 8. This caused our app to freeze for 1.3 seconds on an iPad 4 running iOS 9.

Steps to Reproduce:
1) Create a number of gesture recognizers (our app has a dependency graph of 35 gesture recognizers).
2) Add failure dependencies between the gesture recognizers.
3) Run the code on older hardware running iOS 9.

The sample project has code in ViewController.m that prints the total time to set up the dependencies.

Expected Results:
The performance of iOS 8.

Actual Results:
The sample project takes 1.9 seconds to add the dependencies.

Version:
iOS 9.1 - iOS 9.3 Beta 1

Notes:
-[UIGestureRecognizer requireGestureRecognizerToFail:] should be fast given that N gesture recognizers may have up to N^2 dependencies in complex applications. Even better is if +[_UIGestureRecognizerFailureMap buildFailureMapForFailureRequirements:] was invoked lazily instead of during each new failure dependency.

Configuration:
iPad 4

Attachments:
'GestureLatency.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!