On 1-Dec-09, at 3:21 PM, Kyle Sluder wrote:

On Mon, Nov 30, 2009 at 1:33 PM, Ben Haller wrote:
This is interesting to me, since I am in fact using @public and -> with some ivars to allow faster use of one of my classes. (Yes, I've confirmed
that this is significant in Sampler; it is, in fact, quite a large
percentage of the total time of my app, which has runtimes measured in days, so I do care :->). I understand the concept of the fragile base class problem and so forth; I just didn't realize Apple had done something to fix
it that might affect the performance of my app.  :->

Are you talking about an improvement over using accessor methods, or
over using non-fragile instance variables?  Even though, as Greg
noted, it takes more work to do a non-fragile ivar access because of
the indirection, that is insignificant compared to the time that would
be spent in objc_msgSend.  Especially if the ivars are used so often
that their symbols stick around in the cache.

Currently I'm using @public and accessing ivars directly (because, as you say, objc_msgSend is slow). Apparently even direct ivar access is slower than it used to be, due to non-fragile ivars glue emitted by the compiler, as Greg pointed out. I'm looking for a way to win back some or all of that speed. The previous suggestion of providing access to a struct inside the class is a good idea, I'm going to pursue that eventually.

Ben Haller
Stick Software


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to