Skip to content

Instantly share code, notes, and snippets.

@masonmark
Last active August 5, 2023 03:15
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save masonmark/a79bfa1204c957043687f4bdaef0c2ad to your computer and use it in GitHub Desktop.
Save masonmark/a79bfa1204c957043687f4bdaef0c2ad to your computer and use it in GitHub Desktop.
check whether array index is valid in Swift
// WastingTimeOnStackOverflowTests.swift Created by mason on 2016-09-18.
import XCTest
/// Measures performance of two different ways of checking whether an index is valid
/// for a given array (the variable "a" is an array of 1,000,000 unique strings, and
/// "val" is the index to be checked):
///
/// a.indices.contains(val)
/// vs:
/// val > 0 && val < (a.count - 1)
//
/// Each test checks the validity of 2,192 different integers, using one of the two
/// methods. The end result is that both ways are fast and any difference is extremely
/// marginal. (Hard to measure since it is so small, but the second way might be on the
/// order of 0.00000005 seconds faster.) Therfore, I will use the first (IMO less
/// puke-looking) method henceforth.
///
/// Related SO discussion: http://stackoverflow.com/a/35512668/164017
class WastingTimeOnStackOverflowTests: XCTestCase {
func makeArray(_ count: Int) -> [String] {
var a: [String] = []
for _ in 0..<count {
a.append(UUID().uuidString)
}
return a;
}
func test_performance_of_array_indices_contains() {
let a = makeArray(1_000_000)
var results: [Bool] = []
self.measure {
for val in self.testValues {
let indexIsValid = a.indices.contains(val)
results.append(indexIsValid)
}
}
}
func test_performance_of_manual_index_check() {
let a = makeArray(1_000_000)
var results: [Bool] = []
self.measure {
for val in self.testValues {
let indexIsValid = val > 0 && val < (a.count - 1)
results.append(indexIsValid)
}
}
}
// The testValues array contains 2192 integers:
let testValues = [8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, 8, 6, 7, 5, 3, 0, 9, 483989, 100_000_000, 453453, 43, 34535, 6456566, 234433242, ]
}
Test Suite 'Selected tests' started at 2016-09-18 20:02:00.406
Test Suite 'DerployerTests.xctest' started at 2016-09-18 20:02:00.407
Test Suite 'WastingTimeOnStackOverflowTests' started at 2016-09-18 20:02:00.407
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:57: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' measured [Time, seconds] average: 0.001, relative standard deviation: 15.168%, values: [0.000755, 0.000564, 0.000498, 0.000502, 0.000531, 0.000483, 0.000478, 0.000480, 0.000497, 0.000486], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' passed (1.470 seconds).
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:42: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' measured [Time, seconds] average: 0.001, relative standard deviation: 6.247%, values: [0.000734, 0.000635, 0.000634, 0.000628, 0.000639, 0.000628, 0.000630, 0.000630, 0.000641, 0.000736], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' passed (1.320 seconds).
Test Suite 'WastingTimeOnStackOverflowTests' passed at 2016-09-18 20:02:03.198.
Executed 2 tests, with 0 failures (0 unexpected) in 2.789 (2.791) seconds
Test Suite 'DerployerTests.xctest' passed at 2016-09-18 20:02:03.199.
Executed 2 tests, with 0 failures (0 unexpected) in 2.789 (2.792) seconds
Test Suite 'Selected tests' passed at 2016-09-18 20:02:03.199.
Executed 2 tests, with 0 failures (0 unexpected) in 2.789 (2.793) seconds
Test session log:
/Users/mason/Library/Developer/Xcode/DerivedData/Derployer-aviznqlnnemdnpbomkyrkjakvgot/Logs/Test/E7063509-AD7D-441D-80E6-E8C77924AD51/Session-DerployerTests-2016-09-18_200151-q10aCG.log
Program ended with exit code: 0
Test Suite 'Selected tests' started at 2016-09-18 20:02:25.250
Test Suite 'DerployerTests.xctest' started at 2016-09-18 20:02:25.251
Test Suite 'WastingTimeOnStackOverflowTests' started at 2016-09-18 20:02:25.252
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:57: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' measured [Time, seconds] average: 0.000, relative standard deviation: 11.841%, values: [0.000671, 0.000476, 0.000475, 0.000473, 0.000518, 0.000473, 0.000473, 0.000473, 0.000476, 0.000473], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' passed (1.440 seconds).
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:42: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' measured [Time, seconds] average: 0.001, relative standard deviation: 7.898%, values: [0.000810, 0.000647, 0.000631, 0.000643, 0.000641, 0.000630, 0.000629, 0.000654, 0.000653, 0.000631], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' passed (1.316 seconds).
Test Suite 'WastingTimeOnStackOverflowTests' passed at 2016-09-18 20:02:28.009.
Executed 2 tests, with 0 failures (0 unexpected) in 2.756 (2.757) seconds
Test Suite 'DerployerTests.xctest' passed at 2016-09-18 20:02:28.009.
Executed 2 tests, with 0 failures (0 unexpected) in 2.756 (2.758) seconds
Test Suite 'Selected tests' passed at 2016-09-18 20:02:28.010.
Executed 2 tests, with 0 failures (0 unexpected) in 2.756 (2.760) seconds
Test session log:
/Users/mason/Library/Developer/Xcode/DerivedData/Derployer-aviznqlnnemdnpbomkyrkjakvgot/Logs/Test/21F33912-F263-4517-BA84-C0AEDA118421/Session-DerployerTests-2016-09-18_200223-qRi5NH.log
Program ended with exit code: 0
Test Suite 'Selected tests' started at 2016-09-18 20:02:42.762
Test Suite 'DerployerTests.xctest' started at 2016-09-18 20:02:42.763
Test Suite 'WastingTimeOnStackOverflowTests' started at 2016-09-18 20:02:42.763
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:57: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' measured [Time, seconds] average: 0.000, relative standard deviation: 11.815%, values: [0.000676, 0.000489, 0.000476, 0.000473, 0.000486, 0.000475, 0.000480, 0.000481, 0.000488, 0.000473], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' passed (1.385 seconds).
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:42: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' measured [Time, seconds] average: 0.001, relative standard deviation: 6.254%, values: [0.000738, 0.000753, 0.000684, 0.000633, 0.000636, 0.000637, 0.000629, 0.000690, 0.000684, 0.000652], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' passed (1.234 seconds).
Test Suite 'WastingTimeOnStackOverflowTests' passed at 2016-09-18 20:02:45.383.
Executed 2 tests, with 0 failures (0 unexpected) in 2.619 (2.620) seconds
Test Suite 'DerployerTests.xctest' passed at 2016-09-18 20:02:45.384.
Executed 2 tests, with 0 failures (0 unexpected) in 2.619 (2.621) seconds
Test Suite 'Selected tests' passed at 2016-09-18 20:02:45.384.
Executed 2 tests, with 0 failures (0 unexpected) in 2.619 (2.622) seconds
Test session log:
/Users/mason/Library/Developer/Xcode/DerivedData/Derployer-aviznqlnnemdnpbomkyrkjakvgot/Logs/Test/1A038853-AAC4-4D9C-9D1A-7AE9548DDE92/Session-DerployerTests-2016-09-18_200241-6vx1h7.log
Program ended with exit code: 0
Test Suite 'Selected tests' started at 2016-09-18 20:03:02.231
Test Suite 'DerployerTests.xctest' started at 2016-09-18 20:03:02.232
Test Suite 'WastingTimeOnStackOverflowTests' started at 2016-09-18 20:03:02.233
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:57: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' measured [Time, seconds] average: 0.001, relative standard deviation: 11.661%, values: [0.000675, 0.000477, 0.000485, 0.000474, 0.000485, 0.000481, 0.000496, 0.000474, 0.000536, 0.000475], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' passed (1.384 seconds).
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:42: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' measured [Time, seconds] average: 0.001, relative standard deviation: 5.320%, values: [0.000752, 0.000641, 0.000631, 0.000630, 0.000651, 0.000642, 0.000631, 0.000639, 0.000645, 0.000642], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' passed (1.250 seconds).
Test Suite 'WastingTimeOnStackOverflowTests' passed at 2016-09-18 20:03:04.869.
Executed 2 tests, with 0 failures (0 unexpected) in 2.635 (2.636) seconds
Test Suite 'DerployerTests.xctest' passed at 2016-09-18 20:03:04.869.
Executed 2 tests, with 0 failures (0 unexpected) in 2.635 (2.637) seconds
Test Suite 'Selected tests' passed at 2016-09-18 20:03:04.870.
Executed 2 tests, with 0 failures (0 unexpected) in 2.635 (2.639) seconds
Test session log:
/Users/mason/Library/Developer/Xcode/DerivedData/Derployer-aviznqlnnemdnpbomkyrkjakvgot/Logs/Test/F5E97D45-31A0-46C4-BB6C-9964258E8BF1/Session-DerployerTests-2016-09-18_200300-jM7U0n.log
Program ended with exit code: 0
Test Suite 'Selected tests' started at 2016-09-18 20:03:25.724
Test Suite 'DerployerTests.xctest' started at 2016-09-18 20:03:25.725
Test Suite 'WastingTimeOnStackOverflowTests' started at 2016-09-18 20:03:25.725
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:57: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' measured [Time, seconds] average: 0.001, relative standard deviation: 14.009%, values: [0.000745, 0.000523, 0.000537, 0.000531, 0.000508, 0.000476, 0.000473, 0.000506, 0.000511, 0.000496], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_manual_index_check]' passed (1.386 seconds).
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' started.
/Users/mason/Code/derployer/WastingTimeOnStackOverflowTests.swift:42: Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' measured [Time, seconds] average: 0.001, relative standard deviation: 6.207%, values: [0.000768, 0.000646, 0.000649, 0.000644, 0.000658, 0.000715, 0.000648, 0.000631, 0.000650, 0.000632], performanceMetricID:com.apple.XCTPerformanceMetric_WallClockTime, baselineName: "", baselineAverage: , maxPercentRegression: 10.000%, maxPercentRelativeStandardDeviation: 10.000%, maxRegression: 0.100, maxStandardDeviation: 0.100
Test Case '-[DerployerTests.WastingTimeOnStackOverflowTests test_performance_of_array_indices_contains]' passed (1.319 seconds).
Test Suite 'WastingTimeOnStackOverflowTests' passed at 2016-09-18 20:03:28.431.
Executed 2 tests, with 0 failures (0 unexpected) in 2.704 (2.706) seconds
Test Suite 'DerployerTests.xctest' passed at 2016-09-18 20:03:28.432.
Executed 2 tests, with 0 failures (0 unexpected) in 2.704 (2.707) seconds
Test Suite 'Selected tests' passed at 2016-09-18 20:03:28.432.
Executed 2 tests, with 0 failures (0 unexpected) in 2.704 (2.708) seconds
Test session log:
/Users/mason/Library/Developer/Xcode/DerivedData/Derployer-aviznqlnnemdnpbomkyrkjakvgot/Logs/Test/C31C5B0A-2E55-4B78-BDF5-AD111DE8126D/Session-DerployerTests-2016-09-18_200324-63N4Bi.log
Program ended with exit code: 0
@acamilleri-seekers
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment