Description
scala-cli 0.19.0
When comparing the following invocations:
scala-cli package --standalone test.scala --output standalone.jar
scala-cli package --assembly test.scala --output assembly.jar
scala-cli package --standalone test.scala --output standalone-no-preamble.jar --preamble=false
scala-cli package --assembly test.scala --output assembly-no-preamble.jar --preamble=false
The result are 4 files:
1) -rwxrwxr-x 7,1M standalone.jar
2) -rwxrwxr-x 6,9M assembly.jar
3) -rwxrwxr-x 7,1M standalone-no-preamble.jar
4) -rwxrwxr-x 6,9M assembly-no-preamble.jar
I observe the following inconsistencies:
• 1 and 3 (standalone) are larger than 2 and 4 (assemblies) even though they seem functionally equivalent.
• 1 and 3 (standalone) require about 120ms (depends on the system in question, but it is a lot) of additional startup time compared to 2 and 4 (assemblies). Both when running directly or via java -jar
. I assume there is some launch logic included … ?
• a plain runner script (that downloads dependencies) has an execution time somewhere in between standalone and assembly.
• 4 is marked executable, even though it is not executable (no preamble included)
• 3 is executable (has a preamble included) – preamble is documented to only work for assembly, so this is somewhat expected.
As far as I can tell, --standalone
is just a worse version of --assembly
, so maybe --standalone
should be removed or just become an alias … ?