WIP. Adding perf measurement. Obs, this rev is somewhat broken.