In my experience, data structures for a library module do not degrade performance or memory pressure when they become larger.
For dict, it uses a dynamic hash table as an internal data structure, and the work is done essentially only on the bucket where the modification is performed.
I also looked in the gb_trees module where I found a comment:
Logarithmic behavior (as it should be).
And gb_trees is usually pretty fast, so I'm sure there are not many copies happening.
Generally, if you implement data structures like these in a language such as Erlang, you take care of copying problems, so there is no need to worry about that for the general library functions.
I am re-reading an article on persistent data structures: in the sense of this article, Erlang data structures are fully stable as well as confluent.
Peer stritzinger
source share