TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

[Debugging] With AS_KDEBUG_ENABLE on, CPU sustains 100% on main (recent regression) #409

Open appleguy opened 7 years ago

appleguy commented 7 years ago

Well, at least I learned about a new "Over CPU Budget" label in Instruments!

It looks like the new CA runloop observers are behaving in such a way that calling them triggers a new CATransaction commit to be prepared. It is possibly the implicit CA transaction that gets created by UIKit (I believe this is set up during UIApplicationMain).

In any case, it affects profiling a lot, so we should probably disable the fancy new CA runloop observers until there is time to investigate. This was taken on 10.3.2 with Xcode 8.3.3 tools, and master as of fcb293e0499e50762ed44f0705876bcbc543823a. cc @Adlai-Holler

image image

Adlai-Holler commented 7 years ago

Hmm this is interesting as I wasn't seeing that behavior when I profiled Pinterest against that patch. I'll need to fire it up in instruments and investigate.

cc this gist, which provides a slightly better way to track CA transaction commits. It covers run loop commits and UIKit-forced commits, but it doesn't cover CADisplayLink scrollview-driven commits yet. Still better than the current implementation: https://gist.github.com/Adlai-Holler/91a3ba2388b6ada50647db97c23d2f02