Performance measurement and profiling