perf.R: cache the pi_sum_vec range to match other implementations.