[Rcpp-devel] routine registration

Kevin Ushey kevinushey at gmail.com
Wed Jun 25 21:29:22 CEST 2014


Hi Ramon,

Nice to see that there are people stumbling upon Kmisc and finding it
useful ;) It was developed partially in response to new BioConductor
guidelines requiring packages with source code to register the entry
points, and since that's a pain to do manually, and it was possible to
automate...

I believe everything in the manual applies identically to C++ code -- in
essence, the question is:

    1. Do we take a string, e.g. "C_do_something", and resolve that to some
entry point dynamically, or
    2. Do we pre-resolve these entry points, cache them in the package, and
then enter that way?

and so the second version should be marginally faster, but I doubt you
would notice it unless you were calling that function from the R
interpreter millions of times (and even then other overhead would dominate).

Cheers,
Kevin


On Wed, Jun 25, 2014 at 12:11 PM, Ramon Diaz-Uriarte <rdiaz02 at gmail.com>
wrote:

>
> Dear All,
>
> Does it make sense to use C routine registration
> (
> http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines
> )
> in a package that has C++ code and uses Rcpp? What are the pros and cons?
>
>
> All of my code is C++. Writing the relevant code for routine registration
> is not hard (it is actually automagic if one uses
> https://github.com/kevinushey/Kmisc/blob/master/R/registerFunctions.R).
> But
> I wonder if it really makes sense to do this.
>
> I've googled around and I haven't been able to find much (maybe a problem
> of my google-fu). I've looked at packages in CRAN and BioConductor that
> import Rcpp and almost none, of those I've looked at, use registration
> (except for a few that use Kmisc's registerFunctions).
>
>
> Thanks,
>
> R.
>
>
> --
> Ramon Diaz-Uriarte
> Department of Biochemistry, Lab B-25
> Facultad de Medicina
> Universidad Autónoma de Madrid
> Arzobispo Morcillo, 4
> 28029 Madrid
> Spain
>
> Phone: +34-91-497-2412
>
> Email: rdiaz02 at gmail.com
>        ramon.diaz at iib.uam.es
>
> http://ligarto.org/rdiaz
>
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20140625/5e349b63/attachment.html>


More information about the Rcpp-devel mailing list