Replies: 3 comments 7 replies
-
Hello @Flowdalic , Running script in Scala CLI consists of multiple steps:
Any/all of those steps may be slower.
|
Beta Was this translation helpful? Give feedback.
3 replies
-
I can't reproduce that slowdown locally. After an initial run for both Scala CLI:
Ammonite:
(first one is not the initial run, and seems to be an outlier here) Scala CLI actually seems to be slightly faster here (and consistently so for me locally). |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think scala-cli is great. The using directives take scala scripting to the next level. I am also a long time Ammonite user, which took REPLs for the JVM to the next level. So please don't take the following as bashing either of those.
I started a wild and crazy attempt to run Scala scripts on a low-end ARM (little-endian, armle) machine. Debian provides JDK 17 builds for this architecture, using the Zero VM.
Comparing the run times between scala-cli and Ammonite to execute a simple script shows that scala-cli is approximately 6x slower than Ammonite. The script simply performs a HTTP lookup and counts the number of rows in a table (using jsoup). The sources of the two scripts, one for Ammonite and one for scala-cli, are at the end of the post.
I am curious about the sources of the slowdown. I wonder if it is related to scala-cli using bloop? But maybe Ammonite does the same? I am not familiar with the internals and architecture of both projects.
In any case, it would be great to learn more about it. Maybe the situation can be improved (on both projects). It would be really great to be able to execute Scala scripts on low-end machines too. Even though, I would expect that it is not a high priority. I want to find out how far the JVM ecosystem can go when it comes to scripting for low-end machines and how competitive it would be to e.g., Python. Then, we may shift the boundaries for Scala scripting on low-end machines. Maybe make Scala more attractive for the uncountable low-end machines out there, pushing the whole Scala ecosystem.
scala-cli script:
Ammonite script:
Beta Was this translation helpful? Give feedback.
All reactions