BBmisc icon indicating copy to clipboard operation
BBmisc copied to clipboard

Implement getMinIndex in C

Open jakob-r opened this issue 9 years ago • 0 comments
trafficstars

In it's actual state getMinIndex negates the input and calls the function getMaxIndex which is implemented in C and supposedly fast. The negation decreases speed of getMinIndex slightly as the following benchmark shows:

library(microbenchmark)
library(ggplot2)
library(BBmisc)
x = rnorm(10000)
res = microbenchmark(getMinIndex(x), getMaxIndex(x), times = 1000, control = list(warmup = 1000))
autoplot(res)

image

jakob-r avatar Aug 19 '16 09:08 jakob-r