You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use 'scala -savecompiled ....' when running a scala script, it properly produces the jar file. It is expected that on the second run it would use that jar file in order to speed up execution, but it is not happening.
I clearly see this by timing the execution: in my example the run using scala runner always takes around 7 seconds, while direct run using 'java -jar ...' takes less than 0.5 seconds.
As a workaround, I wrote a shell script that compares files timestamps and based on that decides how to run the script.
Related documentation issue: if I run 'scala --help', I don't even see any mentioning of '-savecompile'. So I wonder what is the story here - maybe this feature is not yet fully implemented?
The text was updated successfully, but these errors were encountered:
@lilyevsky - the feature is fully implemented, with one exception: -save cannot currently be used with scripts that reference any java classes not in module java.base. The problem only appears when running from the compiled jar. See #13760.
The problem seems to be fixed by #15103 which is being reviewed.
@philwalk Thanks for your comment; however, I believe you are talking about different issue.
My issue was, when using '-savecompiled', it runs, but on the second run it compiles it again.
Luckily, I found the source of the problem. @SethTisue mentioned
-savecompiled (aka -save) ....
These two options are not the same! It occurred to me just to try '-save', and it worked as expected.
So I will close this issue, but I would expect some sort of minor fix in the future version:
Add the '-save' option to the output of help text (and maybe some others that are missing).
Remove '-savecompiled' completely, or at least add it to the help and explain what it does ant what it does not do.
Compiler version 3.1.2
If I use 'scala -savecompiled ....' when running a scala script, it properly produces the jar file. It is expected that on the second run it would use that jar file in order to speed up execution, but it is not happening.
I clearly see this by timing the execution: in my example the run using scala runner always takes around 7 seconds, while direct run using 'java -jar ...' takes less than 0.5 seconds.
As a workaround, I wrote a shell script that compares files timestamps and based on that decides how to run the script.
According to http://www.mit.edu/afs.new/sipb/project/scala/scala/scala-2.10.0/doc/tools/scala.html , this feature used to work before in 2.10 version.
Related documentation issue: if I run 'scala --help', I don't even see any mentioning of '-savecompile'. So I wonder what is the story here - maybe this feature is not yet fully implemented?
The text was updated successfully, but these errors were encountered: