Result of performance spike T124336
Make sure the saved page list can scroll smoothly when there are many items. If not, measure CPU usage to determine if there are opportunities for easy optimization to restore smooth scrolling.
• BGerstle-WMF | |
Feb 23 2016, 3:58 PM |
F3506997: T127838-InstrumentsiPhone5S-iOS9.0.2.trace.zip | |
Mar 2 2016, 12:47 PM |
F3506989: T127838-animated_gif_named-2.png | |
Mar 2 2016, 12:47 PM |
F3506991: T127838-animated_gif_named.png | |
Mar 2 2016, 12:47 PM |
F3506990: T127838-trace-animated_gif.png | |
Mar 2 2016, 12:47 PM |
F3506995: T127838-updateSavedButtonState.png | |
Mar 2 2016, 12:47 PM |
Result of performance spike T124336
Make sure the saved page list can scroll smoothly when there are many items. If not, measure CPU usage to determine if there are opportunities for easy optimization to restore smooth scrolling.
@JMinor @Fjalapeno @Mhurd this, along with other results from the tab-switching results in T124336 might be higher priority than some of the other memory consumption optimizations. I think these kinds of CPU usage issues are worse than memory usage because these issues are likely to impact more users and result in a worse UX. If the app consumes a lot of memory, we'll get some warnings and in extreme cases maybe even crash. If CPU use is excessive, the overall UX will be bad, and there's no "CPU usage warning" mechanism to automatically mitigate the issue.
Hi guys, I attach the trace for this profiling.
This is run on iPhone5S, iOS 9.0.2.
Every run contains these steps:
I detected the method that is consuming more time is animated_gif_imageNamed.
The POD AnimatedGIFImageSerialization, LINE 201, is making a method swizzling on imageNamed, replacing it for animated_gif_named.
When a saved cell is built the method updateSavedButtonStateis executed and imageNamed is called from there on the MAIN thread.
Here are some screenshots from the profiling:
Here is the code taking more time:
LINE 201 - FILE AnimatedGIFImageSerialization.m
LINE 214 - FILE AnimatedGIFImageSerialization.m
**+ (UIImage *)animated_gif_imageNamed:(NSString *)name attribute((objc_method_family(new))) {
NSString *path = [[NSBundle mainBundle] pathForResource:[name stringByDeletingPathExtension] ofType:[name pathExtension]]; if (!path) { path = [[NSBundle mainBundle] pathForResource:[[name stringByDeletingPathExtension] stringByAppendingString:@"@2x"] ofType:[name pathExtension]]; } if (path) { NSData *data = [NSData dataWithContentsOfFile:path]; if (AnimatedGifDataIsValid(data)) { return UIImageWithAnimatedGIFData(data); } } return [self animated_gif_imageNamed:name];
}
**
Hi team, I'm not very sure where to move this task now. I've completed the performance profiling, @JMinor @BGerstle-WMF