diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-04-23 22:20:36 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-04-23 23:06:56 +1000 |
commit | 8559e39c8dc2a597a210ebf9b4ee7ea2247e2d62 (patch) | |
tree | 61688f1ed6e14e2215b905a9060800259972ab22 /spec/public/fonts/Heuristica-Regular.woff | |
parent | d063dd32098f1dacdb13fb6bd750a75a444dcacd (diff) | |
download | scala-8559e39c8dc2a597a210ebf9b4ee7ea2247e2d62.tar.gz scala-8559e39c8dc2a597a210ebf9b4ee7ea2247e2d62.tar.bz2 scala-8559e39c8dc2a597a210ebf9b4ee7ea2247e2d62.zip |
SI-9279 Improve performance of bash runner script
In fbe897d16, the template for bash scripts (scala/scalac/etc) was
modified to fix processing of `-J`, `-bootcp`.
This involved looping through the argument array and filtering out
options like `-bootcp` that only influence the script, and shouldn't
be passed to the JVM.
However, the mechanism to do this uses an inefficient, erm,
"CanBuildFrom", and under the load of even a few hundred source
files takes half a second before the JVM starts. Throw 2000 files
at it, and you have to wait ten seconds!
This commit uses a more efficient array append operator. This requires
Bash 3 or above. Hopefully it is safe to presume this version these
days, it's been around for a decade.
Results:
```
% time ~/scala/2.11.6/bin/scalac -J-NOJVM abcdedfghijklmnopqrtsuvwxyv{1..2000} 2>&1
Unrecognized option: -NOJVM
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
real 0m7.765s
user 0m7.734s
sys 0m0.028s
% time ./build/quick/bin/scalac -J-NOJVM abcdedfghijklmnopqrtsuvwxyv{1..2000} 2>&1
Unrecognized option: -NOJVM
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
real 0m0.144s
user 0m0.124s
sys 0m0.022s
```
Thanks to Stephan Schmidt for pointing out the performance gulf.
Diffstat (limited to 'spec/public/fonts/Heuristica-Regular.woff')
0 files changed, 0 insertions, 0 deletions