Re: NSMapTable with C strings as keys
Re: NSMapTable with C strings as keys
- Subject: Re: NSMapTable with C strings as keys
- From: Jens Alfke <email@hidden>
- Date: Thu, 30 May 2013 08:46:32 -0700
On May 29, 2013, at 11:35 PM, Eric Wing <email@hidden> wrote:
> In my introduction, I was fairly adamant that time lost to impedance
> mis-match should be measured because my interest was real performance
> in using these libraries for projects based in C. That conversion time
> is non-trivial.
If you’re coding in C, I don’t think it makes sense to consider other languages (except maybe C++) just for their hashtable implementations! There’s inevitably going to be impedance mismatch: not just with data conversion but also memory management, since most of the languages you tested are garbage collected. That means you now have two heaps (a GC heap embedded inside your malloc heap) and extra memory usage and cost for running the GC. Not to mention the bloat on your app’s code size.
Surely there are enough reusable C-based hashtable libraries that you don’t need to embed a whole Lua or Python interpreter just for that purpose. (And if not, it’s really easy to write one.)
—Jens
_______________________________________________
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