Adding arbitrary resampler with tests and benchmark