Fix performance test integer bitwidth

This commit is contained in:
Christian Treffs 2020-07-09 22:11:33 +02:00
parent 0454e29e45
commit 58c6852ea0
No known key found for this signature in database
GPG Key ID: 49A4B4B460BE3ED4
1 changed files with 7 additions and 7 deletions

View File

@ -13,9 +13,9 @@ class HashingPerformanceTests: XCTestCase {
/// release: 0.726 sec
/// debug: 3.179 sec
func testMeasureCombineHash() {
let a: Set<Int> = Set<Int>([14_561_291, 26_451_562, 34_562_182, 488_972_556, 5_128_426_962, 68_211_812])
let b: Set<Int> = Set<Int>([1_083_838, 912_312, 83_333, 71_234_555, 4_343_234])
let c: Set<Int> = Set<Int>([3_410_346_899_765, 90_000_002, 12_212_321, 71, 6_123_345_676_543])
let a = Set<Int64>([14_561_291, 26_451_562, 34_562_182, 488_972_556, 5_128_426_962, 68_211_812])
let b = Set<Int64>([1_083_838, 912_312, 83_333, 71_234_555, 4_343_234])
let c = Set<Int64>([3_410_346_899_765, 90_000_002, 12_212_321, 71, 6_123_345_676_543])
let input: ContiguousArray<Int> = ContiguousArray<Int>(arrayLiteral: a.hashValue, b.hashValue, c.hashValue)
measure {
@ -29,11 +29,11 @@ class HashingPerformanceTests: XCTestCase {
/// release: 0.494 sec
/// debug: 1.026 sec
func testMeasureSetOfSetHash() {
let a: Set<Int> = Set<Int>([14_561_291, 26_451_562, 34_562_182, 488_972_556, 5_128_426_962, 68_211_812])
let b: Set<Int> = Set<Int>([1_083_838, 912_312, 83_333, 71_234_555, 4_343_234])
let c: Set<Int> = Set<Int>([3_410_346_899_765, 90_000_002, 12_212_321, 71, 6_123_345_676_543])
let a = Set<Int64>([14_561_291, 26_451_562, 34_562_182, 488_972_556, 5_128_426_962, 68_211_812])
let b = Set<Int64>([1_083_838, 912_312, 83_333, 71_234_555, 4_343_234])
let c = Set<Int64>([3_410_346_899_765, 90_000_002, 12_212_321, 71, 6_123_345_676_543])
let input = Set<Set<Int>>(arrayLiteral: a, b, c)
let input = Set<Set<Int64>>(arrayLiteral: a, b, c)
measure {
for _ in 0..<1_000_000 {
let hash: Int = input.hashValue