Skip to content
Prev 33784 / 398513 Next

Execution of R code

I am not sure I fully understand the Qs.

There are two phases.

1) The source code is parsed.
2) The parsed code is evaluated.

If you run code from source() or a file or the command line, it is
parsed and evaluated.  However, evaluating a function assignment makes an 
function object containing the parsed code for the body of a function.

Running code a second time is often faster because of caching of memory
(in the chip's caches and in RAM ratehr than VM). In S-PLUS there are more
layers of caching going on: objects are retrieved from disc and (usually)
cached in memory, and memory allocated for objects can be re-used rather
than re-allocated.

There is no form of pre-compiling to intermediate code on first use (as 
some Java implementations use), although things like that are in Luke
Tierney's long-term plans.

I hope that actually answers your questions.
On Wed, 25 Jun 2003 Ted.Harding at nessie.mcc.ac.uk wrote: