Understanding optimization with Either and Effect in transformations

I got interested in the optimization mentioned in this tweet: https://x.com/MichaelArnaldi/status/1930250026896220482

Am I right in understanding that it’s applied when _op: Either is used in transformations instead of Effect? I’d love to know more about the exact conditions under which this optimization is applied.

While looking through the source code, I noticed that the Concurrency and Batching annotations are also considered in nodes like "Tuple", "TupleLiteral", and "Union". Does that mean the optimization won’t be applied if the schema contains even one such node?
Michael Arnaldi (@MichaelArnaldi)
@dillon_mulroy if you want more perf you can use ParseResult.flatMap instead of Effect.gen and get eager optimization skipping the Effect runtime. Not that you'd need it

X

6/4/25, 1:07 PM

Was this page helpful?