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
Increased compilation times for pattern matching with extractors #4576
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4576?orig=1
|
Trond Olsen (tolsen77) said: |
Trond Olsen (tolsen77) said: raw type trait IndexedSeq -> <root>#scala#collection#IndexedSeq
raw type trait IndexedSeq -> <root>#scala#collection#IndexedSeq
raw type trait IndexedSeq -> collection.this.IndexedSeq[?0] forSome { <deferred> <existential/mixedin> type ?0 }
raw type trait IndexedSeq -> collection.this.IndexedSeq[?0] forSome { <deferred> <existential/mixedin> type ?0 }
[loaded class file D:\project-photonistorg\Photonist\lib\scala-2.9.0\scala-library.jar(scala/Predef$$$$anon$$8.class) in 2ms]
[loaded class file D:\project-photonistorg\Photonist\lib\scala-2.9.0\scala-library.jar(scala/Predef$$$$anon$$9.class) in 1ms]
raw type class Predef$$<:< -> <root>#scala#Predef$$<:<
[loaded class file D:\project-photonistorg\Photonist\lib\scala-2.9.0\scala-library.jar(scala/Predef$$$$anon$$3.class) in 1ms]
[loaded class file D:\project-photonistorg\Photonist\lib\scala-2.9.0\scala-library.jar(scala/Predef$$$$anon$$6.class) in 0ms]
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type trait CanBuildFrom -> <root>#scala#collection#generic#CanBuildFrom
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type class WrappedArray -> <root>#scala#collection#mutable#WrappedArray
raw type trait CanBuildFrom -> <root>#scala#collection#generic#CanBuildFrom |
Trond Olsen (tolsen77) said: java.lang.OutOfMemoryError: Java heap space
at scala.tools.nsc.util.HashSet.growTable(HashSet.scala:98)
at scala.tools.nsc.util.HashSet.findEntryOrUpdate(HashSet.scala:40)
at scala.tools.nsc.symtab.Types$$class.scala$$tools$$nsc$$symtab$$Types$$$$unique(Types.scala:2891)
at scala.tools.nsc.symtab.Types$$TypeRef$$.apply(Types.scala:1948)
at scala.tools.nsc.symtab.Types$$class.typeRef(Types.scala:2677)
at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:13)
at scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:3013)
at scala.tools.nsc.symtab.Types$$SubstSymMap.apply(Types.scala:3495)
at scala.tools.nsc.symtab.Types$$SubstSymMap.apply(Types.scala:3480)
at scala.tools.nsc.symtab.Types$$TypeMap$$$$anonfun$$16.apply(Types.scala:3125)
at scala.tools.nsc.symtab.Types$$TypeMap$$$$anonfun$$16.apply(Types.scala:3122)
at scala.collection.LinearSeqOptimized$$class.exists(LinearSeqOptimized.scala:79)
at scala.collection.immutable.List.exists(List.scala:45)
at scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:3122)
at scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:3024)
at scala.tools.nsc.symtab.Types$$SubstMap.apply(Types.scala:3455)
at scala.tools.nsc.symtab.Types$$SubstSymMap.apply(Types.scala:3499)
at scala.tools.nsc.symtab.Types$$SubstSymMap.apply(Types.scala:3480)
at scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:3026)
at scala.tools.nsc.symtab.Types$$SubstMap.apply(Types.scala:3455)
at scala.tools.nsc.symtab.Types$$SubstSymMap.apply(Types.scala:3499)
at scala.tools.nsc.symtab.Types$$Type.substSym(Types.scala:590)
at scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:3036)
at scala.tools.nsc.symtab.Types$$AsSeenFromMap.apply(Types.scala:3415)
at scala.tools.nsc.symtab.Types$$Type.asSeenFrom(Types.scala:544)
at scala.tools.nsc.symtab.Types$$Type.computeMemberType(Types.scala:573)
at scala.tools.nsc.symtab.Symbols$$MethodSymbol.typeAsMemberOf(Symbols.scala:1867)
at scala.tools.nsc.symtab.Types$$Type.memberType(Types.scala:564)
at scala.tools.nsc.symtab.Types$$Type.findMember(Types.scala:919)
at scala.tools.nsc.symtab.Types$$Type.nonPrivateMembers(Types.scala:482)
at scala.tools.nsc.symtab.Types$$class.lub1$$1(Types.scala:5200)
at scala.tools.nsc.symtab.Types$$class.lub0$$1(Types.scala:5154) |
Trond Olsen (tolsen77) said: |
Trond Olsen (tolsen77) said: I've been able to complete the compilation now but there is still an abnormal long time spent at point in log. |
Trond Olsen (tolsen77) said: (name,arr.toList) match {
case ("a",Extractor1(a) :: Extractor2(b) :: Extractor3(c) :: Nil) =>
case ("b",(x: String) :: (y: String) :: Nil) =>
} Running example code with similar to this form does not lead to any increased compilation time, so might be related to the context of it being part of the large application class. Compilation time slightly improved by changing cons to List(). |
Trond Olsen (tolsen77) said: Total time: 2 minutes 17 seconds (v2.9.0, only cases of typed variables sequenced with List())
Total time: 2 minutes 35 seconds (v2.8.1, all cases sequenced with List())
Total time: 2 minutes 35 seconds (v2.8.1, all cases sequenced with ::)
Total time: 3 minutes 26 seconds (v2.9.0, only cases of extractors sequenced with List())
Total time: 7 minutes 43 seconds (v2.9.0, all cases sequenced with List())
Total time: 10+ minutes (v2.9.0, all cases sequenced with ::) |
Trond Olsen (tolsen77) said: Total time: 13 minutes 55 seconds (cases sequenced with List())
Total time: 7 minutes 34 seconds (cases sequenced with ::)
Total time: 13 minutes 57 seconds (cases sequenced with List())
Total time: 2 minutes 17 seconds (cases sequenced with Array())
Total time: 7 minutes 33 seconds (cases sequenced with ::)
Total time: 2 minutes 18 seconds (cases sequenced with Array()) |
Trond Olsen (tolsen77) said: |
@dragos said: |
Trond Olsen (tolsen77) said: |
@paulp said: |
After upgrading from Scala 2.8.1 to 2.9.0, one of my projects is no longer able to typecheck. All library dependencies have been recompiled successfully to 2.9.0, but my final project is "stuck" during compilation.
Included are stacktrace snapshot (for excel and visualvm) of the recursive behaviour. Below is also the final memory error.
=== What is the expected behavior? ===
Detection of typing error.
=== What do you see instead? ===
=== Additional information ===
Project also had a typing error reported in #4417 which got resolved by removing the access modifier on the constructor.
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: