What should happen here?
John Colvin
john.loughran.colvin at gmail.com
Wed Sep 29 07:23:26 UTC 2021
On Tuesday, 28 September 2021 at 16:22:40 UTC, deadalnix wrote:
> On Tuesday, 28 September 2021 at 06:38:20 UTC, Elronnd wrote:
>> On Monday, 27 September 2021 at 22:15:26 UTC, deadalnix wrote:
>>> [...]
>>
>> Because you need to be able to remove the root later. So it
>> essentially reduces to a hash table. Wrt contention,
>> concurrent hash table is doable
>> (https://github.com/boundary/high-scale-lib/blob/master/src/main/java/org/cliffc/high_scale_lib/NonBlockingHashMap.java) but would need to be implemented; however I agree with Steven that I don't understand why you would do this when you could just store the pointer on the stack or in a register.
>
> Even then, unless you addRoot like mad, linear search through
> the array is goign to be super fast (in fact, LLVM
> DenseSet/DenseMap do exactly that untill the element count gets
> too high).
If you search from most recently added to least recent then it’ll
be super cheap in most cases. Almost stack-like.
More information about the Digitalmars-d
mailing list