benchmarks/bench-appendMinor.R

n <- 5e6
mjrs <- as.character(sample(1:999, n, replace = TRUE))
mnrs <- as.character(sample(0:99, n, replace = TRUE))
microbenchmark::microbenchmark(
  icd9MajMinToCode(mjrs, mnrs, TRUE),
  icd9MajMinToCodeStd(mjrs, mnrs, TRUE),
  # icd9MajMinToCodePrePadded(mjrs, mnrs, TRUE), # removed from repo
  times = 10
)

# std method about the same with O3 (4% faster, but no NA handling), but 50% quicker with O0
# std method without doing padding is 5 times quicker than previous...
jackwasey/icd documentation built on Nov. 23, 2021, 9:56 a.m.