KVO performance degradation; single observer, many objects

Originator:kimtsi
Number:rdar://16179751 Date Originated:02/26/2014
Status:Open Resolved:
Product:OS X Product Version:10.9.2 (13C64)
Classification:Performance Reproducible:Always
 
Summary:
KVO performance degrades when a single observer observes many objects.

Steps to Reproduce:
1. Create a single observer object.
2. Observe a number of different objects.
3. Unobserve.
4. Repeat steps #2 and #3.

Expected Results:
No performance degradation when adding observers. Unobservation performed in Step 3 to have helped mitigate.


Actual Results:
Each observation takes longer and longer. From the sample project attached.

2014-02-26 16:21:41.578 KVOSlowDown[14766:1303] Trial 1 dt:0.046364
2014-02-26 16:21:41.725 KVOSlowDown[14766:1303] Trial 2 dt:0.120685
2014-02-26 16:21:42.021 KVOSlowDown[14766:1303] Trial 3 dt:0.217752
2014-02-26 16:21:42.424 KVOSlowDown[14766:1303] Trial 4 dt:0.275786
2014-02-26 16:21:42.938 KVOSlowDown[14766:1303] Trial 5 dt:0.358562
2014-02-26 16:21:43.635 KVOSlowDown[14766:1303] Trial 6 dt:0.469945
2014-02-26 16:21:44.455 KVOSlowDown[14766:1303] Trial 7 dt:0.558854
2014-02-26 16:21:45.366 KVOSlowDown[14766:1303] Trial 8 dt:0.627054
2014-02-26 16:21:46.423 KVOSlowDown[14766:1303] Trial 9 dt:0.658799
2014-02-26 16:21:47.589 KVOSlowDown[14766:1303] Trial 10 dt:0.766691

Version:
OS X 10.9.2/Build 13C64

Notes:


Configuration:
MacBookPro11,3, Intel Core i7, 2.6 GHz, 16 GB

Attachments:
'MacBook Pro.spx' and 'KVOSlowDown.zip' were successfully uploaded.

Attachment URL:
https://dl.dropboxusercontent.com/u/1898287/rdar/16179751/KVOSlowDown.zip

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!