# NOT RUN {
x <- icd:::generate_random_decimal_icd9(1e4)
system.time(icd:::icd9_sort_cpp(x)) # vastly quicker
system.time(icd:::icd9_order_short(x))
if (require("microbenchmark", quietly = TRUE)) {
# fastmatch was fractionally faster, but either is very slow
microbenchmark(icd:::icd9_order_short(x),
icd:::icd9_order_short_r(x),
times = 10)
# C++ method (which also ignores NA values) is 100x faster.
}
# }
Run the code above in your browser using DataLab