scala/scala — pull request #1823 by paulp (2012-12-27 23:50:42+00:00)
Title: Eliminating allocations.

At this commit the statistics when compiling src/library
are as follows. These counts are precise, collected by a
modified Function1 which counts every instantiation of every
implementing class. The net result is 27 million fewer
allocations, over a 20% drop.

// master (5b5635ee9d), total and top five by count:
Total Function1 allocations: 128,805,865

scala.collection.immutable.$colon$colon 26781958
scala.collection.mutable.ListBuffer 15365174
scala.collection.TraversableLike$$anonfun$map$1 9127787
scala.collection.generic.Growable$$anonfun$$plus$plus$eq$1 4636154
scala.collection.mutable.StringBuilder 3531211

// After these commits, total and top five by count:
Total Function1 allocations: 101,865,721

scala.collection.immutable.$colon$colon 26993704
scala.collection.mutable.ListBuffer 15319656
scala.collection.TraversableLike$$anonfun$map$1 7585019
scala.reflect.internal.Types$MethodType$$anonfun$paramTypes$1 2447307
scala.reflect.internal.Types$SubstSymMap 2436088