Recover performance WIP

With profiling, this goes from 20 to 6 seconds. Without profiling, I expect
lower gains.