Compile-Time Java Stream Fusion via mapMulti
summary
An open-source bytecode-to-bytecode optimizer rewrites adjacents map and filter into a single mapMulti call, using a declarative fee calculus intermediate and about 44 rewrite rules to fuse opcodes. Evaluation on nine benchmarks shows superiority in 2 cases, parity in most, and matches prior unrolling on a megamorphic pipeline with ~10x speedup; the tool passes 31,799 Apache Kafka unit tests but adds roughly 40% extra compile-time.
AI-written summary · about
chapters (11)
- 0:00Java stream optimizations
- 1:29Java streams performance
- 4:23JVM stream pipeline
- 5:28Introducing mapMulti
- 7:13Research questions
- 8:40Fee calculus
- 10:08Bytecode fusion
- 11:55Benchmark results
- 13:40Safety and scalability
- 15:03Key takeaways
- 16:26Q&A
related talks
52mTreasure.map(): Functional Programming in JVM-based languages
13mEliminating Abstraction Overhead of Java Stream Pipelines using Ahead-of-Time Program Optimization
56mJava Functional Programming Idioms
23mDeep Fusion for Efficient Nested Recursive Computations
55mDeforestation and Program Fusion
44mI didn't know you could do that with Java Streams!
51mIf Streams Are So Great, Let’s Use Them Everywhere... Right??
40mLife of a Clojure Expression
