@ WWDC 19
- Reduced responsiveness
- Perceived app freezing
- Functional problems
- Repeatable
- Deterministic
- Low variance
- Representative
- Conditioning the network infrastructure
- Custom routers
- Can be prohibitively complex
- Use Optimistic DNS and TLS 1.3
- Use HTTP/2
- Set reasonable timeouts
- Avoid reachability checks
- Consider differences between testing conditions and the real world
- Use your app with different Link conditions
- Be aware of functional and performance degradation
- Include 3G Network Link in test runs
- Optimize towards progressing app behavior
- Reduce your app's energy impact and contribution to excessive thermal states
- Implement progressive optimizations under elevated thermal states
- Listen to
ProcessInfo.ThermalState
notifications
- Register for
ProcessInfo.thermalStateDidChangeNotification
- Use the
ProcessInfo.ThermalState
cases to react to thermal state changes - Switch off background and unneeded functionaliity when thermal state is elevated
NotificationCenter.default.addObserver(self, selector: #selector(reactToThermalStateChange(_:)), name: ProcessInfo.thermalStateDidChangeNotification, object: nil)
@objc fnc reactToThermalStateChange(_ notification: Notification) {
thermalState = ProcessInfo.processInfo.thermalState
}
var thermalState = ProcessInfo.ThermalState.nominal {
didSet {
switch thermalState {
case .nominal, .fair:
configuration.userFaceTrackingEnabled = true
configuration.frameSemantics = .personSegmentation
sceneView.renderMotionBlur = true
case .serious:
configuration.userFaceTrackingEnabled = false
configuration.frameSemantics = .init()
sceneView.renderMotionBlur = true
case .critical:
configuration.userFaceTrackingEnabled = false
configuration.frameSemantics = .init()
sceneView.renderMotionBlur = false
}
}
}
- Doon't extrapolate behavior from nominal conditions
- Avoid running a dummy CPU load to warm the device
- Don't overlook the energy impact of your app
- Add test runs with adverse device conditions
- Look for progressions in your application behavior
- Activate different Network Links such as 3G
- Activate elevated temperature states such as the Serious state