scala / scala-dev

Scala 2 team issues. Not for user-facing bugs or directly actionable user-facing improvements. For build/test/infra and for longer-term planning and idea tracking. Our bug tracker is at https://github.com/scala/bug/issues
Apache License 2.0
130 stars 15 forks source link

Optimizer benchmark: optimize pattern matches #30

Open retronym opened 9 years ago

retronym commented 9 years ago

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.

lrytz commented 8 years ago

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)