faster histogram reduction