Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-7524

pathologically slow compilation time with -optimize and named/default arguments

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.1
    • Fix Version/s: Backlog
    • Component/s: Optimizer
    • Labels:

      Description

      With -optimize on, this code takes 30 seconds to compile, compared to 5 seconds without the optimizer. If you double the number of repetitions in the body of O, it takes several minutes. Something O(n^2) or worse must be happening.

      Scala 2.9.2, 2.10.1, 2.10.2-RC1, and 2.11.0.M2 are all equally affected.

      I encountered this bug in real code, with a large literal Map containing a lot (about 400) case class instances.

      case class S(
        a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0,
        f: Int = 0, g: Int = 0, h: Int = 0, i: Int = 0, j: Int = 0)
       
      object O {
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
        S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0); S(j = 0)
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sethtisue Seth Tisue
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: