arlo on 2 Jul 2003 17:29:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [ALACPP] smart pointers in C


> Be sure to collect metrics for comparison when trying to improve his  linear
> search. A linear search across a relatively small amount of  consecutive
> memory is often unbeatable. Gavin has a good story about  linear searches,
> and in a non-trivial application which would presumably  benefit from a
> carefully chosen algorithm+data structure.

Absolutely. However, in this case he's doing a linear search through a set. It
will be faster to either linear search a vector or binary search the set
(lower_bound). It may be better yet to binary search a vector (dunno).
However, it is also entirely possible that there's not a lot of speed
difference between any of these methods. Dunno; we'll see.

Arlo


_______________________________________________
alacpp mailing list
alacpp@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/alacpp