Performance degradation of XCTest in iOS 10 in comparison to 9.0 and 9.3

Originator:pjotal
Number:rdar://31936689 Date Originated:02-May-2017
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 10.x
Classification: Reproducible:Always
 
Summary:
It was noticed that UI tests written in XCTest runs about 2.5s slower in iOS 10 in comparison with iOS 9 (please check the logs attached). The performance degradation was noticed in all stages of the execution (app launch, test execution and app termination) but the phase that suffers the most is the app start launch.

Steps to Reproduce:
Environment:
- macOS Sierra 10.12.4
- XCode 8.3.2 (8E2002)
- Language: Swift 3
- MacBook Pro (Intel Core i7 2.2 GHz, 16 GB 1600 MHz DDR3)

Steps to reproduce:
1. Unzip the project attached and open it on XCode
2. Run the tests on `UICatalogUITests`
3. Check the test execution metrics printed in the test logs

Expected Results:
1-3. Test execution time is the same or faster newer versions of iOS

Actual Results:
1-3. Test execution is slower on iOS 10.3 than in iOS 9.x

Version:
iOS 10.3

Notes:
An average of 2.5s performance degradation per test was noticed on XCTest since iOS 9.0.
In the sample project attached we implemented 16 very simple tests to prove this performance degradation.
Several metrics were collected, such as, overall test duration, app launch duration, app terminate duration, etc.
2.5s per test may seem a bit but when scaled to dozens of tests running on CI and on several different dev machines this gets into a relevant number.
We would be glad to see performance upgrades in the next version(s) of XCode and XCTest and make sure it won't keep degrading in future versions of iOS.

Configuration:
Logs collected using iPhone 6s simulator but is slowness is also noticed in real devices.

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!