www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Performance O(??) for associative array lookup

reply Cecil Ward <cecil cecilward.com> writes:
Does D give any guarantees for performance order-something ? 
What’s the current lib implementation like?

Many thanks in advance.
Aug 14
next sibling parent Guillaume Piolat <guillaume.piolat gmail.com> writes:
On Wednesday, 14 August 2024 at 07:48:58 UTC, Cecil Ward wrote:
 Does D give any guarantees for performance order-something ? 
 What’s the current lib implementation like?

 Many thanks in advance.
See the graphs in https://dplug.org/tutorials/Dplug%20Tutorials%2018%20-%20The%20Case%20Against%20Binary%20Trees.pdf Multiple solutions for O(log(N)) insert, delete and look-up, with builtin hashmaps being pretty good.
Aug 14
prev sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On Wednesday, 14 August 2024 at 07:48:58 UTC, Cecil Ward wrote:
 Does D give any guarantees for performance order-something ? 
 What’s the current lib implementation like?
It is amortized O(1), like most hash implementations. -Steve
Aug 16