Regression - CALayers unusably slow in 10.9 (and CARemoteLayerClients sometimes breaks)
| Originator: | ccameron | ||
| Number: | rdar://15896506 | Date Originated: | |
| Status: | Resolved: | ||
| Product: | OS X SDK | Product Version: | 10.9 |
| Classification: | Performance | Reproducible: | Yes |
Summary: As a result of change in 10.9 and the 10.9 SDK, applications that relied on CARemoteLayerClient for performance from 10.7 through 10.8 are broken in 10.9. This is the result of the confluence of two issues. Issue 1: Applications written using the 10.8 SDK that use CoreAnimation run extremely slowly on 10.9 (like, only one layer can be redrawn per vsync). - This appears to be the case because NSWindowHostsLayersInWindowServer is set to NO by when using the 10.8 SDK. This can be fixed by switching to the 10.9 SDK, except, some functionality that the application relies on is broken by the 10.9 SDK. In particular: Issue 2: Applications that use CARemoteLayerClient that worked when using the 10.8 SDK are broken when using the 10.9 SDK - This appears to be because the 10.9 SDK sets NSWindowHostsLayersInWindowServer to YES by default - Specifying setLayerUsesCoreImageFilters:YES in the client application, or setting NSWindowHostsLayersInWindowServer:NO will make the application run, but will now encounter the terrible performance mentioned above. As a result of these two bugs, applications that relied on CARemoteLayerClient for good performance in 10.8 are broken in 10.9 -- there is no way to get them to both function and be performant. Is this a bug in the OS that can be fixed, or is there a new API that can be exposed to accomplish this in 10.9 (perhaps by communicating through the window server)? Steps to Reproduce: For issue 1: CoreAnimation is slow (with the 10.8 SDK, NSWindowHostsLayersInWindowServer:NO, or setLayerUsesCoreImageFilters:YES) 1. download the attached ca_slow.mm 2. build using "clang++ -o ca_slow ca_slow.mm -framework Cocoa -framework Quartz" 3. run using “./ca_slow”, the application will create ~20 windows (use ctrl-C to quit) Expected results: -The windows all update simultaneously from green to red and back. Actual results: - Four the windows will update simultaneously (the ones for which setLayerUsesCoreImageFilters:YES is not set). The other 16 will update extremely slowly, in a cascade. Trying to get those windows to animate at 30-60fps is an impossibility. Notes: Calling setLayerUsesCoreImageFilters:YES produces the same results as NSWindowHostsLayersInWindowServer:NO, or building using the 10.8 SDK For issue 2: CARemoteLayerClient is broken on the 10.9 SDK 1. download the attached ca_remote.mm 2. build using “g++ -o ca_remote ca_remote.mm -framework Cocoa -framework Quartz" 3. run using “./ca_remote”, the application will create 1 window (use ctrl-C to quit) Expected results: - The application will show a green layer. This occurs if you compile with the 10.8 SDK, specify setLayerUsesCoreImageFilters:YES, or use NSWindowHostsLayersInWindowServer:NO). Actual results: - The application will show a red layer. Notes: Instructions for testing with the 10.8 SDK are in the top of the file. Expected Results: For the ca_slow program, the application should update all windows simultaneously. For the ca_remote program, the application should show a green window. Actual Results: For ca_slow, the windows update extremely slowly. For the ca_remote program, the application shows a red window. Version: OS: 10.9.1 (13B42) XCode: 5.0.2 (5A3005) Notes: Configuration: This occurs on all hardware on 10.9. This does not happen on any hardware on 10.8. Attachments: 'ca_slow.mm' and 'ca_remote.mm' were successfully uploaded.
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!