Skip to content
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

perf(scala): use scala-cli first to avoid timeout #5952

Merged
merged 1 commit into from May 12, 2024

Conversation

wahtique
Copy link
Contributor

@wahtique wahtique commented May 1, 2024

Description

  • update Scala module to try first to retrieve the current version with scala-cli and fallback to current ( slower ) scclac
  • update utils.rs mock commands to call scala-cli and get back the current Scala version 3.4.1 before scalac which returns ... 2.13.5 ... . Keep them distinct for clearer testing.

Motivation and Context

Partial fix to #5583

scalac --version has some noticeable ( most likely jvm ) startup time. Depending on the computer, this can cause a timeout. scala-cli version --scala usually has little to no startup time since it is either compiled to a native binary or use its own embedded GraalVM. It also outputs exactly and only the version number which avoids some string parsing.

image

This can only be considered a partial fix as scala-cli is not a hard requirement to work with Scala whereas scalac is.

Screenshots (if appropriate):

image

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@andytom andytom changed the title fix(scala): use scala-cli first to avoid timeout perf(scala): use scala-cli first to avoid timeout May 1, 2024
Copy link
Member

@davidkna davidkna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andytom andytom merged commit 2221a88 into starship:master May 12, 2024
17 checks passed
@andytom
Copy link
Member

andytom commented May 12, 2024

Thank you for your contribution @wahtique and thank you for reviewing @davidkna.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants