Re: [R] slow loading with lme4

From: Prof Brian Ripley <>
Date: Mon 13 Jun 2005 - 20:33:37 EST

On Mon, 13 Jun 2005, Doran, Harold wrote:

> It is actually the Matrix package that is taking so long, not lme4.

Not so: lme4 is taking longer than Matrix:

> system.time(library(Matrix))
[1] 4.17 0.11 4.28 0.00 0.00
> system.time(library(lme4))
Loading required package: lattice
[1] 6.55 0.08 6.64 0.00 0.00

(this is the additional time for lme4, of course).

> It is is extremely large and is required for use with lme4. I think Doug
> Bates or Duncan Murdoch can confirm Matrix() contains more than 6000 or
> so lines of code. But, it is not a problem, it just is what it is.

Actually, only 2302 lines of R code. That of itself is no issue at all: package stats has 23000 lines and loads almost instantly: a default R session loads about 65000 lines in well under a second (about 0.4s on the machine whose timings are given above).

As I have already replied (with numerical evidence), the issue is handling all the S4 methods which the packages define. The developers have put a lot of effort in loading lots of R code fast, but little optimization has been done on loading S4 methods.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Mon Jun 13 20:39:01 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:33 EST