Today, 09:49 AM
(This post was last modified: Today, 10:15 AM by Stanley Durham.)
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.
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.
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.