scala-dev icon indicating copy to clipboard operation
scala-dev copied to clipboard

Optimizer benchmark: optimize pattern matches

Open retronym opened this issue 10 years ago • 1 comments
trafficstars

Existing partest tests: patmat_opt_ignore_underscore, patmat_opt_no_nullcheck, patmat_opt_primitive_typetest.

Also talk to adriaan. Maybe some of the optimizations that are currently in the patmat phase can be performed in the backend instead.

retronym avatar Aug 05 '15 04:08 retronym

example in BooleanOrdering:

    def compare(x: Boolean, y: Boolean) = (x, y) match {
      case (false, true) => -1
      case (true, false) => 1
      case _ => 0
    }

(https://github.com/scala/scala/pull/4835/files#r43673943)

lrytz avatar Nov 04 '15 12:11 lrytz