-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Performance regression in fommil/jzon
#21569
Comments
Variant of reproducer defining all 64 Takes ~60s to compiles using Scala 3.3.0 / 3.3.3 The issue might be also present in 3.3.4-RC2, the full reproducer was timeouts after 5 minutes of compilation |
Bisect points to 5fd810e Last good release: 3.6.0-RC1-bin-20240802-7f5e4ce-NIGHTLY Based on compilation of full reproducer with timeout=240s |
Sounds like we'll need to backport a fix to 3.3.4-RC3 |
Another affected project is https://github.com/andimiller/cats-parse-interpolator - see #21735 (comment) |
The workaround for both projects is to disable pattern match analysis on the code generated code, it successfully reduces the compilation time to ~70s. For example, replace def work(st: SealedTrait1[A, A1]): Unit = st match {
case SealedTrait._1(v) => ???
} with def work(st: SealedTrait1[A, A1]): Unit = (st: @scala.unchecked) match {
case SealedTrait._1(v) => ???
} |
for some definition of "successfully". That's still a huge regression compared to Scala 2. |
We've observed a significant performance regression in the Open Community Build for
fommil/jzon
which now takes 4h to compile. Build logsCompiler version
3.6.0-nightly
Minimized code
The original source code contains instances for CaseClasses, SealedTraits with aritity <1, 64> and Tuples <1, 22>.
The SealedTrait type definitions are defined in non-public library https://javadoc.io/doc/com.fommil/shapely_3/latest/shapely.html
In case of the reproducer compilation time is 2x longer but in the original code base it skyrockets to few hours.
Zip with reproducer source code (too large to paste in the GitHub)
repro.zip
Compilation times
Collected using
scala clean . && time scala compile . -S <version> --server=false
Expectation
The text was updated successfully, but these errors were encountered: