-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Compile times in Scala 3 are very slow since 0.11.4-M2 #332
Comments
@lihaoyi yeah it might be private def reduceUps(in: Array[String]): List[String] =
in.foldLeft(List.empty[String]) { case (acc, x) =>
acc match {
case h :: t if h == ".." => x :: acc
case h :: t if x == ".." => t
case _ => x :: acc
}
}.reverse Probably prepending elements to list with |
I will get it done as soon as I have time, however if anyone wants to pick ,just feel free |
That code looks very reasonable to me. |
I saw some other compile performance issues that were fixed going from scala 3.5.0 to 3.5.2. Let me see if this one follows suit or whether it sticks around |
Back in the days of early scala 3, prepending to tuple with *: was raising compilation time a lot, that's why I suspect :: . Maybe it's just an object creation that is costly, and we do it every :: call. |
@lihaoyi based on referenced PR I assume that it occured while compiling mill itself(?). Did you check if slowdown is present only on M2 (not on M1)? |
I think I did, let me go back and bisect properly to try and verify |
So much so that we had to roll back the OS-Lib version when upgrading Mill from Scala 2->3 in com-lihaoyi/mill#3369. We were seeing maybe 20x compile slowdowns, with 15s compiles instead taking 300s.
Most likely culprit is the macro changes introduced in #329. Probably some naive implementations need optimizing.
CC @pawelsadlo in case anything springs to mind, otherwise I'll get around to looking into it eventually
The text was updated successfully, but these errors were encountered: