Adding perf code from initial experiments