Beam relies heavily on the fact that runners can fuse ParDos together, however the way it´s done today generates extremely long call chains that defeats Java´s HotSpot optimization (e.g. HotSpot C2 gives up on inlining once the callstack is 15 deep, and in some cases we exceed that after a single fused DoFn!). This is not a new finding. This problem has been known for some time and people have taken stabs at addressing it.
I'm proposing a couple of techniques to address this issue. These techniques have both been prototyped, and show significant improvement both in microbenchmarks and in production pipelines (run on Dataflow). Here is the design document <https://docs.google.com/document/d/1pniAZRX79dKO51w-Yspo6SD0qcpcnzTPn6j2VaPVOJ0/edit?tab=t.0#heading=h.sp4lw5g8txp1>. Please review and leave comments! Reuven
