Re: cocoa bindings performance
Re: cocoa bindings performance
- Subject: Re: cocoa bindings performance
- From: Tom Davie <email@hidden>
- Date: Sun, 17 Feb 2013 12:37:31 +0000
Sorry I can't be of more direct help, but…
Cocoa bindings are unfortunately one of many tools that apple produces with the thought "we can make this small task I do repeatedly much easier" in their head, that typically doesn't cover the general case. They're enormously productive if all you're doing is one of the obvious, standard UIs. Unfortunately, as soon as you want to do something more complex, that typically breaks down with almost any structure. This is due to 3 things:
1) Debugging them is near impossible – you end up wasting as much time as you save trying to track down what's wrong.
2) Lack of flexibility – you eventually hit a wall where bindings simply can't do what you want any more and need to rewrite everything.
3) Performance – you can't tune anything with these technologies typically.
My advice would simply be to steer well clear of bindings (along with a couple of other techs that supposedly make life easier, like CoreData and Storyboards).
Thanks
Tom Davie
On 15 Feb 2013, at 19:42, Maximilian Marcoll <email@hidden> wrote:
>
> Hi everyone!
>
> I have a problem with bindings, or so it seems.
>
> In my application, I need to programmatically create lots of small views embedded in a big view.
> Think of them as draggable items on a plane.
>
> Thus far I'm controling the views using bindings. Four bindings per view to be precise.
> The bindings bind the views to controller objects, which are connected to my model objects.
> The bindings are used to change the model objects' values according to their size and their position on the plane and vice versa.
>
> If I the app has to manage only a small number of items everything works fine.
> But when there are very many items (views) to create, the app slows down considerably and is basically unuseable.
>
> I assumed that I somehow wrote very unefficient code in my views or something like that and I used the Time Profiler to see what actually is the most time consuming operation.
> It appears that the method consuming 90% of the time is:
> -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] .
>
> Now, I'm obviously missing something here. What I want is to have lots of small rectangular items on a plane.
> Hundreds, or even thousands of them.
> I want to be able to drag them around, change their size and have those properties change values in my model.
>
> It seems very unlikely to me that creating bindings for those views is actually that time consuming by itself.
> Or is it?
>
> Any help is much appreciated!
>
> Thank you!!
>
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden