character
and NA
-containing data by switching to R_orderVector
for these data types?"first"
... actually I might be able to always use a stable sort, since I have the index vector already I only exchange equivalent values if their index values are inverted.configure
?fastrank
and the other interfacesrank
and fastrank
and direct entries are absolutely identical in all of themfastrank
ties.method
?Makevars
and Makevars.win
(mentioned in http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-C_002b_002b11-code)I don't know what sorts of things I might run into with submitting this to CRAN, so I would like to anticipate them as much as possible. Some of the TODO and Completed address this concern but here I will collect more specific links and thoughts.
.Internal
is implemented via a dispatch table compiled into the R executable, so there is no way we can beat the speed of its call interfacePACKAGE = "fastrank"
in the R wrapper.Call("fastrank_", x, ties)
is faster than .Call("fastrank_", x, length(x), ties)
src/fastrank.c.bak2
.fr_quicksort_double_i_
does indices onlyfastrank_num_avg
, no longer sorting the passed vector.C
vs. .Call
, and found .Call
is 5-25% faster (faster with shorter vectors)fastrank
, checking for character in R wrapper and in C code, how much faster is it to avoid one or both of these? The check in R wrapper happens for all invocations, but the check in C code happens after a switch
and only if the TYPEOF is actually character, so should be much faster for all cases. Or is that not true? Did I move the check earlier so as to avoid the R_orderVector
call?rank
does, fastrank
returns a double vector if ties.method=="average"
, integer otherwiseAdd the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.