scala/scala — pull request #3696 by retronym (2014-04-24 08:59:17+00:00)
Title: SI-8531 Better space efficiency for patmat anaylsis

By adding logging to `clause`, I found that the majority of
calls provide 0 or 1 elements. In SI-7020 / 69557da55, we changed this
method to use a `LinkedHashSet` to have deterministic results
for clauses with more elements. But I suspect that this
contributes to higher memory usage from the pattern matcher.

SI-8531 doesn't come with a test case (yet), so this analysis
is based on a little guesswork after analysing the heap dump
from @owbowlake's project.

I'll submit this as a pull request and ask him to try again
with the pr validation snapshot build of the compiler.

I have run `neg/t7020.scala` in a loop and it still is deterministic.

Review by @adriaanm