Resolving Performance Issues with `Effect.partition` on Large Inputs in TypeScript

Why does Effect.partition seem to hang on largish inputs? What's the performant way of doing this?
const test = Array(500000).fill(2);

const parseItem = (item: unknown) => Schema.decodeUnknown(Schema.Number)(item);

const parseItems = Effect.gen(function* () {
  const [errors, successes] = yield* Effect.partition(test, parseItem);
  yield* Effect.log(successes.length);
}).pipe(Effect.catchAllCause((e) => Effect.logError(e)));

Effect.runPromise(parseItems);
Was this page helpful?