scala/scala — pull request #3444 by retronym (2014-01-31 20:40:05+00:00)
Title: Avoid generic collections operations hot paths

- Use a specialized version of List#{map, collectFirst}
These special case mapping over an empty list and avoid
allocating.
- Avoid nonEmpty in favor of `ne Nil`

I see in the order of 2% speedup.

Perhaps more useful is that
these methods no longer dominate the YourKit profiles, even though
profiler bias due to safepoints at allocation of the ListBuffer
might have been overstating their significance.

Review by @gkossakowski / @ichoran