Speedups using Scala in hot map/reduce loops