- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
Why field variables are much slower then local variables in JIT compilers?
from my experience with ScalaLab, I observed that when I wrap
computational code within a method of a synthetic Scala object it is
executed much faster (i.e. 10 to 60 times faster) than when the same
code runs as a Scala script.
This obviously has its reason with the implementation of variables in
script with field variables in Scala Interpreter code.
It is of course necessary in order to keep the binding of the variables
to their values in the synthetically created interpreter "global"
but can somebody explain why so much speed difference in favor of local