perf(timeseries): reduce allocations in series build and merge (#5311)