[Rcpp-devel] Copyright Issue of using 3rd party C/C++ library in R package

Dirk Eddelbuettel edd at debian.org
Sun Sep 8 18:59:52 CEST 2013


On 9 September 2013 at 00:12, Wush Wu wrote:
| Dear Dirk,
| 
| About hiredis, I am trying to improve the efficiency of rredis with Bryan, the
| maintainer of rredis now. Even though we might not need hiredis, the copyright
| issue will still bother me in the future.

CCing Bryan. I have been planning to work more with redis at work, which is
why I was interested in your initial rcpp+hiredis work (apart from helping
come to grips with the Rcpp binding).
 
| Note that your example is interesting, because it shows that the performance of
| rredis is irrelevant to object size:
| 
| 
| 
| > object.size(X)
| 90032 bytes
| > object.size(1L)
| 48 bytes
| > microbenchmark(unit="us",
| +                                                        redisSet("a", X),
| +                                                        redisSet("a", 1L)
| + )
| Unit: microseconds
|               expr      min        lq    median       uq      max neval
|   redisSet("a", X) 1073.182  2840.758  3152.705 39996.36 83851.59   100
|  redisSet("a", 1L)  939.156 39572.178 39916.634 40098.82 68149.80   100
| > 

There is one weird outlier! Definitely something fishy here. Same on my box:

R> microbenchmark(unit="us", redisSet("a1", X), redisSet("a2", 1L), redisSet("a3", 1.0))
Unit: microseconds
               expr       min       lq   median      uq     max neval
  redisSet("a1", X)   905.677  1333.61  7217.48 39889.7 64037.0   100
 redisSet("a2", 1L) 36876.231 39903.94 39981.90 40015.7 41065.8   100
  redisSet("a3", 1) 36793.451 39900.30 39994.63 40035.1 43977.8   100
R> 

How could the min be so much smaller?  Caching?

We should split the benchmark into "all work before talking to redis" (eg
serializatio, where C++ may help though it is already efficient inside R) and
the pure "talking to redis" part.

| > microbenchmark(unit="us",
| +                                                        serialize(X, NULL),
| +                                                        serialize(1L, NULL)
| +                                                        )
| Unit: microseconds
|                 expr     min      lq   median       uq      max neval
|   serialize(X, NULL) 173.906 183.578 190.7025 197.3725 8127.923   100
|  serialize(1L, NULL)   7.474   9.464  10.3725  10.9660   84.020   100

Good. There is random variation with the serialization. 

I was trying to factor out access to the serialization for my little rhiredis
variant, but then something else came ... and the two demo scripts I have in
that little github repo showed little to no need for hiredis over basic redis.

But Bryan, you and I should take this off this list...

Dirk 
 
 
| Thanks for this test case. I will discuss it with Bryan.
|  
| 
|     | I looked into many DESCRIPTION files of CRAN package which contains 3rd
|     party C
|     | library, but I still cannot understand whether I should merge the author
|     of the
|     | library into the AUTHOR field or I only need to put the reference of 3rd
|     party
|     | library in the COPYRIGHT field.
| 
|     It is inconsistent, but possibly changing. There are old ones that don't
|     have
|     it, newer ones tend to.
| 
|     | - Sources are provided by the OS, the user should manually download the
|     source
| 
|     Or use his package manager of choice.  No COPYRIGHT or AUTHOR issue.
| 
|     | - Sources are embedded in the package but unchanged. The R package links
|     to the
|     | 3rd party library.
| 
|     CRAN would say sources in the papckage, with COPYRIGHT and AUTHOR
|     implications.
| 
|     | - Sources are modified.
|     | - Reproduce the source file into a single file and put it in the `src`
|     | directory.
| 
|     Ditto.
| 
|     | I am not sure if here is a right place to discuss this issue. Please let
|     me
|     | know if it is inappropriate.
| 
|     As Romain said, it is a generic packaging issue which you should discuss on
|     r-devel.
|    
| 
| 
| Thank you, Romain and Dirk.
| 
| Sorry that I wrongly asked the question here.

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list