Skip to content

Commit 3417ee6

Browse files
committed
[benchmark] RGBHistogram Legacy Factor
1 parent 8d00ce0 commit 3417ee6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

benchmark/single-source/RGBHistogram.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@ import Foundation
1919
import TestsUtils
2020

2121
public let RGBHistogram = [
22-
BenchmarkInfo(name: "RGBHistogram", runFunction: run_RGBHistogram, tags: [.validation, .algorithm]),
23-
BenchmarkInfo(name: "RGBHistogramOfObjects", runFunction: run_RGBHistogramOfObjects, tags: [.validation, .algorithm]),
22+
BenchmarkInfo(name: "RGBHistogram",
23+
runFunction: run_RGBHistogram,
24+
tags: [.validation, .algorithm],
25+
legacyFactor: 10),
26+
BenchmarkInfo(name: "RGBHistogramOfObjects",
27+
runFunction: run_RGBHistogramOfObjects,
28+
tags: [.validation, .algorithm],
29+
legacyFactor: 100),
2430
]
2531

2632
@inline(never)
2733
public func run_RGBHistogram(_ N: Int) {
2834
var histogram = [(key: rrggbb_t, value: Int)]()
29-
for _ in 1...100*N {
35+
for _ in 1...10*N {
3036
histogram = createSortedSparseRGBHistogram(samples)
3137
if !isCorrectHistogram(histogram) {
3238
break
@@ -164,13 +170,11 @@ func createSortedSparseRGBHistogramOfObjects<S : Sequence>(
164170
@inline(never)
165171
public func run_RGBHistogramOfObjects(_ N: Int) {
166172
var histogram = [(key: Box<rrggbb_t>, value: Box<Int>)]()
167-
for _ in 1...100*N {
173+
for _ in 1...N {
168174
histogram = createSortedSparseRGBHistogramOfObjects(samples)
169175
if !isCorrectHistogramOfObjects(histogram) {
170176
break
171177
}
172178
}
173179
CheckResults(isCorrectHistogramOfObjects(histogram))
174180
}
175-
176-

0 commit comments

Comments
 (0)