Re: Adding more and more key/value observers is much too slow - workaround needed.

2009-08-12 Thread Chris Kane
On Aug 12, 2009, at 11:15 AM, Andy Lee wrote: On Aug 12, 2009, at 11:37 AM, Christopher Kane wrote: Don't pass the observer as the context: argument; pretty much anything else is better. Out of curiosity -- why would this affect performance and why is this a bad idea (other than performanc

Re: Adding more and more key/value observers is much too slow - workaround needed.

2009-08-12 Thread Andy Lee
On Aug 12, 2009, at 11:37 AM, Christopher Kane wrote: Don't pass the observer as the context: argument; pretty much anything else is better. Out of curiosity -- why would this affect performance and why is this a bad idea (other than performance)? Isn't the context: treated as an opaque p

Re: Adding more and more key/value observers is much too slow - workaround needed.

2009-08-12 Thread Christopher Kane
Don't pass the observer as the context: argument; pretty much anything else is better. Passing NULL (just, for example) flattens the curve quite a bit. If you have nothing better to pass in, put this in your code and pass the address of it: static char _xyzzy_ = 0; Chris Kane Cocoa Fram

Adding more and more key/value observers is much too slow - workaround needed.

2009-08-03 Thread Andreas Känner
Hi, If you add more and more key/value observers with addObserver:forKeyPath:options:context: this call takes longer and longer in a non-linear way. I posted a bug report today (ID: 7112953) but maybe someone already has a workaround. Here is my sample code: #include @interface ModelO