perf(core): Bound peak memory when computing source control status (#33837)