| Message |
String comparison really isn't that slow. So, to answer your question, the time spent comparing strings will be very low, especially if you store them in a fast lookup format (e.g. a tree, or binary search over a sorted list of strings) -- but frankly, even a linked list will be quite fast.
A hybrid solution is to create a runtime correspondence between the flag names and integers, and use those integers to create the numerical bit vectors. If bitvectors are implemented correctly, that is, with no limit on the number of flags you could put in, then you get the speed of numerical comparison with the flexibility you were describing with strings.
But seriously, the string comparisons really aren't that slow... you'd have to be doing a LOT of them to really feel the difference. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | top |
|