File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
src/test/scala/eu/sim642/adventofcode2025 Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments