3 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
The author shares their experience migrating a service from Scala 2.13 to Scala 3, which initially seemed successful but later revealed performance issues. They discovered that a bug in a library caused a significant slowdown, highlighting the importance of testing and benchmarking when upgrading language versions.
If you do, here's more
The author shares their experience moving a codebase from Scala 2.13 to Scala 3, highlighting unexpected performance issues that arose during the migration. Initially, the transition seemed smooth, with all tests passing and no problems in testing environments. However, after deploying to production, they noticed a significant increase in Kafka lag and a drop in processing rate, despite normal upstream loads. Rolling back the changes restored performance, prompting further investigation into the slowdown.
Through load testing and profiling, the author discovered that the issue stemmed from a specific library called quicklens, which had become inefficient in Scala 3. The CPU profile showed a marked difference, with the JIT compiler and decoding process consuming much more time than before. The author traced the problem to a subtle bug in chained evaluations within Scala 3, which led to increased CPU usage. After updating the library, the performance returned to levels comparable to Scala 2.13. This experience underlines the importance of thorough testing and benchmarking during migrations, particularly with libraries that rely on meta-programming, as they can behave unpredictably across versions.
Questions about this article
No questions yet.