Profile and optimize