-
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
Compilation performance regression on 3.4.0 #19924
Comments
those don't look related, it's a regression specifically moving from 3.3.3 to 3.4.0 |
for a single module with ~150 files it regresses from 17 seconds to 28 |
i think i have a lead - one file using reflection heavily via https://github.com/softwaremill/magnolia is compiled in 2 secs on 3.3 and in 3 secs on 3.4 |
@jchyb @nicolasstucki any ideas, where we might look? @OlegYch as was said earlier in the thread, it may be very hard to track this in any way without diving into the codebase. |
In order I would try
|
ok here is profile output:
3.4.0
i noticed 3.4.0 triggers gc almost every time, while 3.3.3 seems less memory hungry profile details are the same for 3.3.3 and 3.4.0:
|
so by comparing runNs it looks like |
You may try enabling the - val inlining = noPrinter
+ val inlining = default Then compile the code with Note that enabling this may slow down the compilation a bit more. |
(Some context for those not already familiar: building a snapshot is necessary to enable this extra logging, because in the production compiler the logging is inlined out of existence for performance reasons.) |
here is minimized repro https://github.com/OlegYch/magnolia-test |
fwiw |
not much difference in inlining logging:
3.4.2:
|
not sure how to procede further... |
I think bisecting is the best approach ATM. It will give a better hint what caused the regression. |
apparently this is a windows specific issue, at least i can't repro it on freebsd or wsl |
Maybe it's (also) Java-specific? What JDK are you using? |
thought so, but i tried 17,21,22 oracle or graal on win, and 17 and 21 openjdk on wsl |
ok, i managed to bisect and it says 607e4d59d93e4ceb0e46469923161516c4e04b60 is the first bad commit, which seems plausible |
|
looks like it's just a matter of calling isDirectory too much |
…tory calls Fixes scala#19924 backport to start-3.4.1
Compiler version
3.4.0
Expectation
using sbt 1.9.8 in a project of about 500 files split equally between 4 modules compilation time was 70 seconds on scala 3.3.3
scalacOptions is
-feature, -unchecked, -deprecation, -explaintypes, -encoding, UTF8, -language:_, -Yretain-trees, -Xmax-inlines:100, -no-indent
Actual
with scala version 3.4.0 same sources with same libs compile in about 120 seconds
The text was updated successfully, but these errors were encountered: