I’m building software to replicate the calculation logic of Microsoft Excel. My code involves many steps that were (originally) very time and resource intensive. However, over the last few months, I’ve found a reliable approach for semi-automated performance optimization that works across wall-time, RAM, CPU, and probably any quantifiable metric of performance.