Skip to content

Commit

Permalink
Adjusting performance benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Sep 23, 2014
1 parent 571ac98 commit b972f44
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Tests/SurgeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ import Surge
import XCTest

class SurgeTests: XCTestCase {
let count: Int = 100000000
let count: Int = 100000
var repeatedValue: Double = Double(arc4random())
var numbers: [Double] = []

override func setUp() {
self.numbers = [Double](count: count, repeatedValue: repeatedValue)
}

// func testPerformanceNaive() {
// var sum: Double = 0.0
//
// self.measureBlock() {
// sum = reduce(self.numbers, 0.0, +)
// }
//
// XCTAssertEqualWithAccuracy(sum, repeatedValue * Double(count), 1.0, "incorrect sum")
// }
func testPerformanceNaive() {
var sum: Double = 0.0

self.measureBlock() {
sum = reduce(self.numbers, 0.0, +)
}

XCTAssertEqualWithAccuracy(sum, repeatedValue * Double(count), 1.0, "incorrect sum")
}

func testPerformanceSurge() {
var sum: Double = 0.0
Expand Down

0 comments on commit b972f44

Please sign in to comment.