Skip to content

Commit d612f3c

Browse files
committed
Updates for Scala 3.5
1 parent 618a237 commit d612f3c

File tree

3 files changed

+80
-78
lines changed

3 files changed

+80
-78
lines changed

fury

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ repo propensive/gossamer
88
repo propensive/ambience
99
repo propensive/eucalyptus
1010
repo propensive/wisteria
11+
repo propensive/diuretic
1112

1213
target probably/test
1314

@@ -20,7 +21,7 @@ project probably
2021
module bench
2122
compiler scala
2223
sources src/bench
23-
include probably/core
24+
include probably/core diuretic/core
2425

2526
module cli
2627
compiler scala

src/bench/benchmark.scala

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,41 @@ extension [TestType](test: Test[TestType])
3030
baseline: Optional[Baseline] = Unset)
3131
(using runner: Runner[ReportType],
3232
inc: Inclusion[ReportType, Benchmark],
33-
specificDuration: SpecificDuration[DurationType] = timeInterfaces.long,
34-
genericDuration: GenericDuration[DurationType] = timeInterfaces.long)
33+
specificDuration: DurationType is SpecificDuration = durationApi.javaLong,
34+
genericDuration: DurationType is GenericDuration = durationApi.javaLong)
3535
: Unit =
3636

3737
val action = test.action
3838
var end = System.currentTimeMillis + warmup.or(SpecificDuration(10000L)).milliseconds
3939
val times: scm.ArrayBuffer[Long] = scm.ArrayBuffer()
4040
times.sizeHint(4096)
4141
val ctx = new TestContext()
42-
42+
4343
while System.currentTimeMillis < end do
4444
val t0 = System.nanoTime
4545
val result = action(ctx)
4646
val t1 = System.nanoTime - t0
4747
times += t1
48-
48+
4949
times.clear()
50-
50+
5151
end = System.currentTimeMillis + duration.or(SpecificDuration(10000L)).milliseconds
52-
52+
5353
while System.currentTimeMillis < end do
5454
val t0 = System.nanoTime
5555
val result = action(ctx)
5656
val t1 = System.nanoTime - t0
5757
times += t1
58-
58+
5959
val count = times.size
6060
val total = times.sum
6161
val min: Long = times.min
6262
val mean: Double = total.toDouble/count
6363
val max: Long = times.max
6464
val variance: Double = (times.map { t => (mean - t)*(mean - t) }.sum)/count
6565
val stdDev: Double = math.sqrt(variance)
66-
66+
6767
val benchmark =
6868
Benchmark(total, times.size, min.toDouble, mean, max.toDouble, stdDev, confidence.or(95), baseline)
69-
69+
7070
inc.include(runner.report, test.id, benchmark)

0 commit comments

Comments
 (0)