Enabled profiling plus minor optimizations