improved performance for reduce/rightReduce methods