Very Fast WString /Object Hash Table (Comments)
#1
One thing I learned from this, for absolute speed, you can’t use normal WString comparison. Also, Equal is faster than Comparison if that’s all you need, which is the case with a hash table. Comparison requires two comparisons to determine if it’s less than or greater than. For absolute speed, you can’t use; If A$ = B$ Then.
In the Equal callback, testing the lengths first immediately eliminates some values. Passing a pointer and the length to the callback eliminates that overhead in the callback.
I could get this faster, about 0.095 seconds to find 1,000,000 keys, by writing the code inline instead of using callbacks, but the complexity isn’t worth the benefit.

Code:
Very Fast WString /Object Hash Table
Reply


Messages In This Thread
Very Fast WString /Object Hash Table (Comments) - by Stanley Durham - Today, 02:20 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)