berndbischl / BBmisc

Other
20 stars 7 forks source link

Implement getMinIndex in C #65

Open jakob-r opened 8 years ago

jakob-r commented 8 years ago

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