Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
best method for testing smoothness #204
I'm am currently investigating using AsyncDisplayKit with ASCollectionView. I want to benchmark my best effort with both the conventional approach and ASCollectionView. I imagine FB has performed various benchmarks over the course of this project and was hoping to gain some insight as to the best approach toy validate smoothness.
The core animation instrument is not very useful. It only records FPS every second whereas I would like to know how what was happening every time a frame was dropped. My current approach is to autoscroll the collection view with a recursive function and setContentOffset:animated to eliminate human error. Then use the CA tool and just ensure the FPS is higher in the async case while ensuring the main thread activity is lower. In my sync case, the main thread is 94 % running time while the async main thread running time is 24%. I know that the system will not draw at 60 FPS if it does not have to so I don't know if I am really dropping frames. There must be a cleaner approach than this.
@geoffmacd This is a good question and I wanted to answer it when I first saw it submitted way back in January — sorry I never got around to it!
The mechanism I've used is as simple as manually profiling your app (Time Profiler in Instruments). Then look for time on the main thread. Any time over about 10ms, especially if you know it will happen within a single runloop (e.g. call stack growing and then collapsing back to the base) will cause frame drops for scrolling, gestures, and physics-simulating animations.
The FPS measurement is not very useful because you may be holding a pretty high average FPS, but then drop a bunch of frames together; or only drop one frame per second, but it still feels bad. Basically FPS measurement does not correlate well with the human perception of the user experience.
Please feel free to post a topic on our Google Group for any further questions or discussion — I'd love to help! https://groups.google.com/forum/#!forum/asyncdisplaykit