| 11-12-2007, 11:12 PM | #1 |
I have a system that requires at least 5000 string checks done in a semi-instant, just for the convenience. In GUI, and it works too, works well, strangely enough. Code:
For Each Integer a from 1 to 50
For Each Integer b from 1 to 100
If StringSetA[a] == StringSetB[b]
set Belongs[b] = aBut I was thinking, what if I made 2 arrays of each set. The first containing only those that start with the 6 most common starting letters (T, O, A, W, B, C). Assuming they add up to a 1:1 ratio with the rest. This would save 3000+ checks(5000 - (25 x 50+25 x 50)). But would require <750(5 x (50 + 100)) substr functions called. Is that a good idea? |
| 11-17-2007, 02:14 AM | #2 |
agh... it makes no sense, what are you trying to accomplish with this? |
| 11-17-2007, 02:24 AM | #3 |
This is the kind of thing hash tables were designed for, and, guess what? gamecache is a hash table... |
