[Rd] Pre-compilation and server-side parallel execution

Byron Ellis ellis at stat.harvard.edu
Wed Dec 13 01:16:33 CET 2006

On 12/8/06, Erik van Zijst <r at erik.prutser.cx> wrote:
> 2. R's native C-api
> [http://cran.r-project.org/doc/manuals/R-exts.html#The-R-API] does not
> separate parsing from evaluation. When the same script is evaluated 10
> times, it is also parsed 10 times.
> I'm mostly concerned about the second issue. Our scripts are registered
> once and continuously evaluated. I want to avoid parsing the same script
> again each time it is evaluated. Does the engine recognize previously
> parsed scripts (like oracle does for SQL queries)?

A database server is doing rather more than simply parsing a
query--it's also running a query planner to optimize execution and
quite possibly a number of other things so it behooves the DBMS to
cache that information whenever possible. The closest functional
equivalent in R would be wrapping everything in a function and then
serializing the resulting function somewhere.

More information about the R-devel mailing list