scala/scala — pull request #4175 by Ichoran (2014-11-30 21:49:49+00:00)
Title: SI-7981  toSeq on immutable Map and Set return ArrayBuffer

Switched to `Vector` for the default `MapLike`/`SetLike`, then back again in `mutable.MapLike`/`mutable.SetLike`.

Preliminary performance testing indicates an across-the-board improvement due to cutting out a great deal of indirection. In the case of empty immutable maps or sets, the improvement is enormous: it quickly returns Vector.empty instead of jumping through all sorts of hoops to eventually create an empty `ArrayBuffer`.

One possible downside is that `Vector` is pretty memory-hungry for small collections. Need to evalute this; rather than abandoning this change, it's probably better to make `Vector` smarter about small collections.