Backport tuple2 allocation removal to 3.3.x

(x, y) match { case (X, Y) => ...

The optimization is there in 3.8.x and 2.13, but not in 3.3.x

background: perf: compact compare() method for better JIT inlining by He-Pin · Pull Request #725 · databricks/sjsonnet · GitHub

It has been tried, but the optimization itself was depending on changes made by introduction of named tuples. See Fix #23224: Optimize simple tuple extraction by noti0na1 · Pull Request #23373 · scala/scala3 · GitHub discussion. It was leading to all kinds of problems under the 3.3 LTS backport

Scala 3.9 LTS is coming soon giving both opportunity and reason to upgrade.

3 Likes

Thanks, I will give it a try this weekend, this is essential for me.

1 Like