- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Re: delay in running a script
Fri, 2009-03-06, 23:34
>>>>> "Russ" == Russ Paielli writes:
Russ> I am still learning Scala, and I am using #! scripts to get
Russ> started. I am finding that I need to wait something like 20 to 30
Russ> seconds every time I run a short script. That gets a bit wasteful
Russ> of my time when I am running them over and over.
That seems absurdly long; I don't know why it would be taking that long.
My Mac can run a one-line Scala script in just 2 or 3 seconds:
~> cat foo.scala
println(5)
~> time scala foo.scala
5
rlwrap scala -Xnojline foo.scala 0.26s user 0.07s system 11% cpu 2.868 total
~> time scala -nocompdaemon foo.scala
5
rlwrap scala -Xnojline -nocompdaemon foo.scala 1.68s user 0.15s system 96% cpu 1.903 total
It's peculiar that it's faster with -nocompdaemon; I don't know what the
story is there.
Have you tried using -savecompiled? That will save you time on
consecutive runs, at least.