3 ms·
>> which by the way manages efficiency concerns on your behalf > Can you elaborate on this? Sure thing. As a start the form `{:a 1, :b 2}` would start as an
by fogus 16y ago
>> which by the way manages efficiency concerns on your behalf
> Can you elaborate on this?
Sure thing. As a start the form `{:a 1, :b 2}` would start as an array-map because it's really fast to populate while the access efficiency is reasonable. At some point during the use of that map it will cross some critical threshold and become a hash-map providing (effectively) constant time lookup while still maintaining persistence. Additionally, behind the scenes Clojure uses mutable versions of the map for efficiency while again maintaining persistence.
Clojure provides different types of maps for use in different scenarios, but manages implementation efficiencies for you.