Very Fast WString /Object Hash Table (Comments)
#6
Asked Google AI: “How long will it take the best hash tables to find 1,000,000 string keys”
“A C++ benchmark showed highly optimized implementations like ClickHouse's HashMap performing 1 million lookups in about 200 milliseconds, significantly outperforming a standard library implementation.”
Asked Google AI: “how fast is ClickHouse HashMap on 1,000,000 strings”
“For one million strings, ClickHouse's highly optimized hash table can operate in as little as 0.201 seconds, making it extremely fast for aggregation and lookup tasks.”
“In a 2023 benchmark, ClickHouse's custom hash map implementation was faster than several well-known C++ alternatives: Google DenseMap: 0.261s, Abseil HashMap: 0.307s, std::unordered_map: 0.466s
 
This is faster than all those, 0.112 seconds, and I can get it down to 0.095 seconds with a lot of inline code.
This might be the world’s fastest hash table. I tried random keys 10 to 20 characters long, still faster, 0.127 seconds. And I can make it faster with inline code.
 
You can change the test count: Local testcount As Long : testcount = 1000000 'can change
You can change the string size: Function RandomString() As String, For i = 1 To Rnd(5, 8)

If i cheat and use this to build the keys:

Code:
    ReDim a(1 To testcount)
    For i = 1 To testcount
        'a(i) = RandomString()
        a(i) = Format$(i)
    Next i
instead of this: 
Code:
    ReDim a(1 To testcount)
    For i = 1 To testcount
        a(i) = RandomString()
        'a(i) = format$(i)
    Next i
then I can get it down to 0.035 seconds for 1,000,000 keys
Reply


Messages In This Thread
RE: Very Fast WString /Object Hash Table (Comments) - by Stanley Durham - 11 hours ago

Forum Jump:


Users browsing this thread: 1 Guest(s)