Add a performance test for sample_multi
Speed up a bit get_index