Performance improvements on reduction