Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

very slow compilation due to humonguous LUB #5862

Closed
scabug opened this issue Jun 1, 2012 · 5 comments
Closed

very slow compilation due to humonguous LUB #5862

scabug opened this issue Jun 1, 2012 · 5 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Jun 1, 2012

Only typechecking takes 10 seconds. If I add the commented type ascription, it goes down to 700ms.

It looks like the least-upper bound computation for the 'if' takes most of this time.

(Maybe this can be minimized further)

package test

import java.io.DataOutput
import java.io.DataInput

/** Interface for writing outputs from a DoFn. */
trait Emitter[A] {
  def emit(value: A): Unit
}

/** A wrapper for a 'map' function tagged for a specific output channel. */
abstract class TaggedMapper[A, K, V]
    (val tags: Set[Int])
    (implicit val mA: Manifest[A], val wtA: WireFormat[A],
              val mK: Manifest[K], val wtK: WireFormat[K], val ordK: Ordering[K],
              val mV: Manifest[V], val wtV: WireFormat[V])
  extends Serializable {
}

/** Type-class for sending types across the Hadoop wire. */
trait WireFormat[A]

class MapReduceJob {
  trait DataSource
  
  import scala.collection.mutable.{ Set => MSet, Map => MMap }
  private val mappers: MMap[DataSource, MSet[TaggedMapper[_, _, _]]] = MMap.empty
  
  def addTaggedMapper[A, K, V](input: DataSource, m: TaggedMapper[A, K, V]): Unit = {
    if (!mappers.contains(input))    
      mappers += (input -> MSet(m))
    else  
      mappers(input) += m // : Unit

    m.tags.foreach { tag =>
    }
  }
}
@scabug
Copy link
Author

scabug commented Jun 1, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5862?orig=1
Reporter: @dragos
Affected Versions: 2.9.0, 2.10.0

@scabug
Copy link
Author

scabug commented Jun 26, 2012

@retronym said:
Improved a bit recently:


  ~/code/scala time scalac210 sandbox/t5862.scala

real	0m15.253s
user	0m32.602s
sys	0m0.875s
  ~/code/scala time ./build/quick/bin/scalac sandbox/t5862.scala

real	0m7.675s
user	0m15.998s
sys	0m0.793s

Both take about 4.8s with the type ascription.

@scabug
Copy link
Author

scabug commented Jun 26, 2012

@dragos said:
Jason, thanks for the update!

We could probably mark it as fixed, but ideally we'd know the commit. It should be backported to 2.9.x

@scabug
Copy link
Author

scabug commented Jun 26, 2012

@retronym said:
I'd guess: scala/scala@1dd02bdd72

@scabug
Copy link
Author

scabug commented Jul 21, 2012

@odersky said:
Indeed the fixing commit is scala/scala@1dd02bdd72.

@scabug scabug closed this as completed Jul 21, 2012
@scabug scabug added the typer label Apr 7, 2017
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants