Very Fast WString /Object Hash Table (Comments)
#5
There are no other options for PB users. It will find 10,000,000 random keys in 1.936 seconds.
Asking Google AI: “How long will it take the best hash tables to find 10,000,000 wide string keys” = one second
“This is a very rough estimate …”
Based on “rough estimate” about a second slower than the very best on 10,000,000 keys. Almost world class code.
It’s worthy of an update.

(Today, 09:28 AM)Steven Pringels Wrote: Hi Stanley,

The following code

Code:
Class Method LongFromObj(o As IUnknown) As Long
  If IsObject(o) Then
     o.AddRef()
     Method = Peek(Long, VarPtr(o))
  End If
End Method

wouldn't it be better to use ObjPtr?

Code:
Class Method LongFromObj(o As IUnknown) As Long
    If IsObject(o) Then
        o.AddRef()
       Method = ObjPtr(o) 'Peek(Long, VarPtr(o))
    End If
End Method

Probably. Will require some testing. It might make a big difference. This is fast of finding key but will be dramatically slower getting the object due to overhead.

Didn’t work, it crashed. Not sure why, but it could be that the reference count must be increased before calling that, it may not increase the count. In which case, it might only be slightly faster.
I’m afraid to mess with it.
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)