PERF: speed for label timeseries2matrix