optimized percentiles computing