perf

Profile and optimize hotspots.