Improving reduce performance