Performance improvements to process1.sum and unit test