Re: Best Way To Lookup From a Huge Table
Re: Best Way To Lookup From a Huge Table
- Subject: Re: Best Way To Lookup From a Huge Table
- From: Thomas Engelmeier <email@hidden>
- Date: Sat, 22 Mar 2008 19:46:36 +0100
On 21.03.2008, at 21:51, John Stiles wrote:
std::map actually does more than NSDictionary—it sorts its entries
instead of keeping them in random order. Also, it copies its keys
instead of just keeping a reference to them, which is also more work—
it would be a much fairer test if you used std::string* pointers for
your keys and values instead of std::string objects, but it'd also
be a little more work since you'd need a custom comparator and you'd
need to consider memory management (which boost smart pointers
apparently can manage pretty well).
No need to pull in the whole boost overhead for smart(er) pointers as
of gcc 4.0.
#include <tr1/memory>
using std::tr1::shared_ptr;
And for the presorting time - TR1 includes also an unordered_map and
unordered_set.
Regards,
Tom_E
_______________________________________________
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