how to optimize workflows for better performance