• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Key-Value Observing speed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Key-Value Observing speed


  • Subject: Re: Key-Value Observing speed
  • From: Eli Bach <email@hidden>
  • Date: Fri, 12 Mar 2010 16:09:27 -0700

On Mar 12, 2010, at 3:41 PM, Gwynne Raskind wrote:

> You're right; the specific call that's causing the worst speed issues is returning a property typed with this structure:
>
> typedef struct { int32_t x, y; } IntegerPoint;
>
> It's not necessarily feasible to switch this to an NSPoint; it means digging up every point in the code that relies on signed 32-bit integer math and doing manual typecasting (or calling lround()) away from CGFloat. If there's no way to cheat KVO into doing this sanely, I'll resign myself to it, but I kinda hope there's something a little less annoying.
>
> (It's even more annoying because it *was* an NSPoint in a much earlier iteration of the code and I changed it because it simplified the code in two dozen places, and because the property in question is integer and doesn't need the slower floating-point instructions to manipulate it.)

Could you cheat by kvo-ing it as a uint64 [maybe by unioning the struct to make sure it gets 8-byte aligned as necessary]?

Eli

_______________________________________________

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

References: 
 >Key-Value Observing speed (From: Gwynne Raskind <email@hidden>)
 >Re: Key-Value Observing speed (From: Peter Ammon <email@hidden>)
 >Re: Key-Value Observing speed (From: Gwynne Raskind <email@hidden>)

  • Prev by Date: Re: Clicking on an NSColorWell
  • Next by Date: Re: Use of KVC Array operators
  • Previous by thread: Re: Key-Value Observing speed
  • Next by thread: Re: Key-Value Observing speed
  • Index(es):
    • Date
    • Thread