Take some ideas from https://github.com/kwgoodman/bottleneck/tree/master/bottleneck/benchmark