Re: ObjC in time-critical parts of the code
Re: ObjC in time-critical parts of the code
- Subject: Re: ObjC in time-critical parts of the code
- From: Scott Ribe <email@hidden>
- Date: Mon, 19 Jan 2009 18:04:24 -0700
- Thread-topic: ObjC in time-critical parts of the code
> but the decision has *nothing* to do with non-virtual
> member functions or other such oft-touted C++ speed improvements
But actually, it does. The fact is that std::lower_bound is a template that
specializes on the types of the iterators, so what you get is different code
generated depending on the iterator types, and in the case where the
iterators are simple pointers, a whole lot of "functions" that wind up
incurring no function calls at all, but reducing to simple pointer
increments and comparisons, inline--all made possible by static typing
information and C++'s ability to exploit that info. (And even in the cases
where the iterators are more complex, such as maps or sets, the functions
are probably only a line or two and also wind up inlined.)
Exactly the kind of thing I was talking about much earlier in the thread.
There's nothing wrong with NSArray, NSSet & NSDictionary--but the library of
data structures & algorithms in C++ is far more extensive.
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
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