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
Dynamic runner startup significantly slower - add option to force CoreRunner? #1460
Comments
I might be wrongly attributing the slowdown to startup time (vs formatting time) - but the argument for the flag that prevents the slowdown remains. |
Thank you for reporting :)
As you mentioned, it's impossible because there's always overhead for downloading the scalafmt-core from maven (or from cache).
As you said, just having a message doesn't make people notice that we are using |
It's not always downloading AFAICT, and to me it's no more useful than the currently available The only way of running scalafmt that's fast enough to be used as a git hook / all the time is - in my mind - via nailgun, and this is only when the versions match. The least we can do for people to start recognize how fast scalafmt can be is to document the fact that the versions need to match for good performance. Since I find documenting stuff that can be enforced porgramatically a half-measure, I proposed having a flag, with the intent of people who read the manual discovering it. Maybe though it should be recommended for tooling use. Without the flag, everyone needs to re-do the flags logic in their tooling for scalafmt to be perceived fast. And it can be fast, to the extent I don't even notice it being in the hook. |
Ok, maybe it can be useful to have such kind of option on |
@ArturGajowy do you have project filters in your |
I think the config in question was this, so I think yes (there are |
I'm using scalafmt via nailgun, which as you know gives rapid startup and execution times. When executing on a project using a different scalafmt version in
.scalafmt.conf
file than the one behind nailgun, startup times are slower than reformatting a whole commit when the versions match:It'd be great to pass an option (say:
--require-same-version
) to error whenever there'd be a need to use the dynamic runner. This would prevent the slowdown by forcing me to update.Without passing any flags, I think a warning should be emitted, saying 'you're running scalafmt 2.0.0, but the config you're using requires a different version, which leads to slower startup and execution'. That would at least be true for scalafmt behind nailgun.
Having just the warning would be better than nothing, but would likely go unnoticed (e.g. IDEA doesn't show git hook output till they fail) or require clumsy scripting in the git hook (scanning for the warning in scalafmt output).
Even better solutions would be:
Having the flag would be more than enough for me though :)
The text was updated successfully, but these errors were encountered: