From mdowle at mdowle.plus.com  Thu Apr 12 08:54:17 2012
From: mdowle at mdowle.plus.com (Matthew Dowle)
Date: Thu, 12 Apr 2012 07:54:17 +0100
Subject: [Rd] Byte compilation of packages on CRAN
In-Reply-To: <4F86666F.1000905@stats.ox.ac.uk>
References: <1334172994.7257.46.camel@netbook>
	<4F86666F.1000905@stats.ox.ac.uk>
Message-ID: <b3988354c7b278bc0958e5315c3c8edd.squirrel@webmail.plus.net>

> 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 :
>> http://www.divms.uiowa.edu/~luke/R/compiler/compiler.pdf
>> 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
> Extensions' says
>
> '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).'
>

Oops, somehow missed that. Thank you!

> 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.
>
>> Thanks,
>> Matthew
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
> --
> 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
>



[Rd] Byte compilation of packages on CRAN
Matthew Dowle