This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Does currying in Scala imply some performance penalty?

Currying per se does not have a performance penalty. If f and g are methods defined as

  def f(x: Int)(y: Int) = expr
  def g(x: Int, y: Int) = expr

then f(x)(y) and g(x, y) are compiled into exactly the same code.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland