[Rd] Byte compilation of packages on CRAN
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Apr 12 07:21:51 CEST 2012
On 11/04/2012 20:36, Matthew Dowle wrote:
> In DESCRIPTION if I set LazyLoad to 'yes' will data.table (for example)
> then be byte compiled for users who install the binary package from CRAN
> on Windows?
No. LazyLoad is distinct from byte compilation. All installed packages
use lazy loading these days (for simplicity: a very few do not benefit
from it as they use all their objects at startup).
> This question is based on reading section 1.2 of this document :
> I've searched r-devel and Stack Overflow history and have found
> questions and answers relating to R CMD INSTALL and install.packages()
> from source, but no answer (as yet) about why binary packages for
> Windows appear not to be byte compiled.
> If so, is there any reason why all packages should not set LazyLoad to
> 'yes'. And if not, could LazyLoad be 'yes' by default?
I wonder why you are not reading R's own documentation. 'Writing R
'The `LazyData' logical field controls whether the R datasets use
lazy-loading. A `LazyLoad' field was used in versions prior to 2.14.0,
but now is ignored.
The `ByteCompile' logical field controls if the package code is
byte-compiled on installation: the default is currently not to, so this
may be useful for a package known to benefit particularly from
byte-compilation (which can take quite a long time and increases the
installed size of the package).'
Note that the majority of CRAN packages benefit very little from
byte-compilation because almost all the time of their computations is
spent in compiled code. And the increased size also may matter when the
code is loaded into R.
> R-devel at r-project.org mailing list
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-devel