> On Oct 1, 2015, at 12:02 AM, Ben <ben_cocoa_dev_l...@yahoo.co.uk> wrote:
> 
> Using NSString's drawInRect:withAttributes: wants a Swift dictionary of 
> attributes. Instruments showed a lot of time spend accessing the elements of 
> this dictionary and converting back to Objective-C land.
> Converting the string to be drawn to an NSAttributedString and adding 
> attributes to it directly before drawing with drawInRect: resulted in string 
> drawing dropping from ~65% of drawRect time to ~50%.

Ah, that's interesting. So just passing a Swift Dictionary to an API that takes 
an NSDictionary triggers an expensive conversion. Sort of disheartening, at 
least to me (I spend more time than most of you having to worry about low-level 
performance issues.)

—Jens
_______________________________________________

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

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

Reply via email to