Open kevinushey opened 10 years ago
Eliminating the code bloat and replacing with variadic templates was awesome. We need to quantify the difference, but it is quite huge.
Using variadc templates is not something i anticipate regular users to do, but this can contribute to the section that introduces Rcpp11.
For some hard numbers, I count 31,428 lines of code in the inst/include
directory of Rcpp11
, while there are 92,726 total lines of code in inst/include
for Rcpp
(latest git revision on master for each). So it looks like Rcpp11
is literally a third of the size, and I imagine most of that is due to the removal of code bloat.
(Counted with a simple find . -name "*.h" | xargs wc -l
.)
That's about what I had in mind, but :
Date
, DateTime
, ...) So maybe that should be a per feature count. e.g. for:
Here's a gist counting the number of lines per feature in Rcpp
, Rcpp11
.
Feature counts are done by grepping through file paths for the associated feature name (so e.g. everything in a module
directory is counted as part of the module
feature. Could be made better but this is a nice place to start)
Also, we see that 59k lines of generated code is completely gone in Rcpp11.
Could be easily extended to look at other features of interest.
Nice.
@kevinushey I added you as a collab to this repo in case you want to put your script somewhere in the repo and do some edits.
Awesome, thanks! I'll add it soon.
A brief discussion of the removal of code bloat and how e.g. the
Vector::create
methods became quite trivial to implement. It might be worth comparing to methods in R that take a variable number of arguments (egc
,rbind
,sum
, ...)