Add instrumentation around commits and optimization