This repository contains two benchmark modules to compare performance between Scala 2 and Scala 3 implementations:
- Scala Version: 3.8.1
- Dependencies: Depends on the local
coremodule (new implementation) - Purpose: Benchmarks the current Scala 3 implementation
- Scala Version: 2.13.18
- Dependencies: Depends on the published
commons-corelibrary version 2.2.4 - Purpose: Benchmarks the previously published Scala 2 implementation for comparison
Both modules use the same benchmark code to ensure fair comparisons:
- Benchmark sources are located in
benchmarks2/src/main/scala/ - The
benchmarkmodule uses its sources frombenchmark/jvm/src/main/scala/andbenchmark/src/main/scala/ - Scala 2-specific compatibility code is in
benchmark/jvm/src/main/scala-2.13/
MongoDB and Redis-related benchmarks have been removed as they are no longer relevant for the core library comparison.
sbt "project benchmark" "Jmh/run"sbt "project benchmarks2" "Jmh/run"sbt "project benchmark" "Jmh/run -i 5 -wi 3 -f 1 .*someWriting"The .github/workflows/benchmark.yml workflow automatically:
- Runs benchmarks on both Scala 2 and Scala 3 implementations on every PR
- Generates JSON results for both versions
- Compares the results and posts a comment to the PR with:
- Performance metrics (ops/second)
- Percentage improvements/regressions
- Visual indicators (🟢 for improvements, 🔴 for regressions)
Benchmark results are saved in JSON format:
benchmark-scala3-results.json- Scala 3 implementation resultsbenchmark-scala2-results.json- Scala 2 published version results
These files are uploaded as GitHub Actions artifacts for historical tracking.