Remake perf test as a pure unit test