On 4/27/10 1:16 PM, Dominick Samperi wrote:
It appears that the runtime for an R script can more than double if a few
references to a function foo() are replaced by more explict references
of the form pkgname::foo().
The more explicit references are of course required when two
loaded packages define the same function.
I can understand why use of this mechanism is not free in an
interpreted environment like R, but the cost seems rather high.
`::` is a function, so there is going to be overhead. OTOH, there is no
reason to pay for the lookup more than once. For example at startup,
you could do:
myfoo <- pkgname::foo
And then later call myfoo() and I don't think you will see the added cost.
You can formalize the above approach in package code by renaming
function in the importFrom directive where I believe you can do:
importFrom(pkgname, myfoo=foo)
+ seth
--
Seth Falcon | @sfalcon | http://userprimary.net/
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel