Skip to content

Commit f6db1ca

Browse files
committed
Benchmark 2025 day 11
1 parent 87edbe6 commit f6db1ca

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package eu.sim642.adventofcode2025
2+
3+
import Day11.*
4+
import org.scalameter.Bench
5+
import org.scalameter.api.Gen
6+
7+
object Day11Benchmark extends Bench.Group {
8+
9+
val inputDevices = parseDevices(input)
10+
11+
abstract class SolutionBenchmark(solution: Solution) extends Bench.LocalTime {
12+
performance of solution.getClass.getSimpleName in {
13+
performance of "Part 1" in {
14+
measure method "countPaths" in {
15+
using (Gen.unit("input")) in { _ =>
16+
solution.Part1.countPaths(inputDevices)
17+
}
18+
}
19+
}
20+
21+
performance of "Part 2" in {
22+
measure method "countPaths" in {
23+
using (Gen.unit("input")) in { _ =>
24+
solution.Part2.countPaths(inputDevices)
25+
}
26+
}
27+
}
28+
}
29+
}
30+
31+
class ViaMapSolutionBenchmark extends SolutionBenchmark(ViaMapSolution)
32+
33+
class ViaPairSolutionBenchmark extends SolutionBenchmark(ViaPairSolution)
34+
35+
class PermutationsSolutionBenchmark extends SolutionBenchmark(PermutationSolution)
36+
37+
include(new ViaMapSolutionBenchmark)
38+
include(new ViaPairSolutionBenchmark)
39+
include(new PermutationsSolutionBenchmark)
40+
}

0 commit comments

Comments
 (0)