Open
Description
Needlessly creating tuples has a major performance impact when building maps. The standard library to some extent routes around this by accessing package-private addOne(key, value)
methods on some builders of maps that happen to expose it (HashMapBuilder
for instance).
I think that users of Scala who care a lot about performance might want to use this technique as well.
Also, users implementing their own high-performance composite data structures may get use out of having a MapBuilder#get(key): Option[V]
or MapBuilder#getOrElse(key, value): Value
, see #11296 for an example use-case within the standard library.