From ripley at stats.ox.ac.uk  Thu May 30 10:01:14 2013
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 30 May 2013 09:01:14 +0100
Subject: [Rd] What is preferable - a single large package or a few
 smaller packages?
In-Reply-To: <CA+hbrhVtuHJpw1SLQmqAQiXy1NBUn7qMGMrDJFG9iNoWvxPF5A@mail.gmail.com>
References: <CA+hbrhVtuHJpw1SLQmqAQiXy1NBUn7qMGMrDJFG9iNoWvxPF5A@mail.gmail.com>
Message-ID: <51A7074A.40701@stats.ox.ac.uk>

On 29/05/2013 23:38, Peter Langfelder wrote:
> Hi all,
>
> I maintain the WGCNA package which at present has nearly 200
> functions. In the future there will be more. Curious whether it would
> be preferable or useful to split the package into a couple different
> ones with different aims. Obviously, when one calls a function in R,
> package name spaces have to be traversed to find the matching name -
> does the speed of this depend on how functions are  partitioned into
> packages? Any other considerations? My knowledge of R internals in
> this regard is pretty non-existent - thanks for any pointers.

Namespace environments are hashed, so essentially lookup is independent 
of size.  And since lazy-loading the memory footprint depends far more 
on what has been used in the session than the number of functions.

In any case, 200 functions is not a 'large' package.  'stats' has nearly 
1100 in its namespace ....  Performance for really large packages was 
improved to the point of a being a non-issue before 2.0.0.


-- 
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] What is preferable - a single large package or a few smaller packages?
Prof Brian Ripley