Scripts with instant startup #3158
Labels
enhancement
New feature or request
performance
Issues concerning performance of the CLI.
Scala Native
scripting
Issues tied to *.sc script inputs.
Is your feature request related to a problem? Please describe.
When running a scala script with native compilation, there is a noticeable delay.
Example:
test.sc
isI run:
time ./test.sc
(compilation happens) and againtime ./test.sc
. I get:The startup time is 0.6s (which (on my computer) actually a tiny bit slower than with JVM compilation).
The documentation seems to indicate that it is possible to get instant startup using native (https://scala-cli.virtuslab.org/docs/cookbooks/introduction/instant-startup-scala-scripts/).
Describe the solution you'd like
This script to finish in a non-noticeable amount of time, not 0.6s. For comparison, on the same machine, a comparable Python script runs 0.03s.
This would allow to write scripts that can be used interactively in the shell, with reactivity comparable to shell scripts or Python scripts.
Describe alternatives you've considered
.scala-build
). This means that one has to manually ensure that the compilation is up to date, and also find the file. Not suitable for scripting.Additional context
#3127 raised the same problem but was closed because (as far as I understood) it raised several issues in one.
The text was updated successfully, but these errors were encountered: