mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Raise the number of iterations for more precise average
This commit is contained in:
1 parent
ae60de399e
commit
c26df67e78
5 files changed
+19
-7
No files matched your search
@@ -15,7 +15,9 @@ class FetchPositionalValuesTests: XCTestCase {
|
||||
var connection: OpaquePointer? = nil
|
||||
sqlite3_open_v2(url.path, &connection, 0x00000004 /*SQLITE_OPEN_CREATE*/ | 0x00000002 /*SQLITE_OPEN_READWRITE*/, nil)
|
||||
|
||||
measure {
|
||||
let options = XCTMeasureOptions()
|
||||
options.iterationCount = 50
|
||||
measure(options: options) {
|
||||
var count = 0
|
||||
var statement: OpaquePointer? = nil
|
||||
sqlite3_prepare_v2(connection, "SELECT * FROM item", -1, &statement, nil)
|
||||
@@ -56,7 +58,9 @@ class FetchPositionalValuesTests: XCTestCase {
|
||||
try generateSQLiteDatabaseIfMissing(at: url, insertedRowCount: expectedRowCount)
|
||||
let dbQueue = try DatabaseQueue(path: url.path)
|
||||
|
||||
measure {
|
||||
let options = XCTMeasureOptions()
|
||||
options.iterationCount = 50
|
||||
measure(options: options) {
|
||||
var count = 0
|
||||
|
||||
try! dbQueue.inDatabase { db in
|
||||
|
||||
@@ -50,7 +50,9 @@ class FetchRecordOptimizedTests: XCTestCase {
|
||||
try generateSQLiteDatabaseIfMissing(at: url, insertedRowCount: expectedRowCount)
|
||||
let dbQueue = try DatabaseQueue(path: url.path)
|
||||
|
||||
measure {
|
||||
let options = XCTMeasureOptions()
|
||||
options.iterationCount = 50
|
||||
measure(options: options) {
|
||||
let items = try! dbQueue.inDatabase { db in
|
||||
try Item.fetchAll(db)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@ class InsertPositionalValuesTests: XCTestCase {
|
||||
try! FileManager.default.removeItem(atPath: databasePath)
|
||||
}
|
||||
|
||||
measure {
|
||||
let options = XCTMeasureOptions()
|
||||
options.iterationCount = 50
|
||||
measure(options: options) {
|
||||
_ = try? FileManager.default.removeItem(atPath: databasePath)
|
||||
|
||||
var connection: OpaquePointer? = nil
|
||||
@@ -67,7 +69,9 @@ class InsertPositionalValuesTests: XCTestCase {
|
||||
}
|
||||
try! FileManager.default.removeItem(atPath: databasePath)
|
||||
}
|
||||
measure {
|
||||
let options = XCTMeasureOptions()
|
||||
options.iterationCount = 50
|
||||
measure(options: options) {
|
||||
_ = try? FileManager.default.removeItem(atPath: databasePath)
|
||||
|
||||
let dbQueue = try! DatabaseQueue(path: databasePath)
|
||||
|
||||
@@ -64,7 +64,9 @@ class InsertRecordOptimizedTests: XCTestCase {
|
||||
try! FileManager.default.removeItem(atPath: databasePath)
|
||||
}
|
||||
|
||||
measure {
|
||||
let options = XCTMeasureOptions()
|
||||
options.iterationCount = 50
|
||||
measure(options: options) {
|
||||
_ = try? FileManager.default.removeItem(atPath: databasePath)
|
||||
|
||||
let dbQueue = try! DatabaseQueue(path: databasePath)
|
||||
|
||||
@@ -4,7 +4,7 @@ require 'json'
|
||||
|
||||
tests = {}
|
||||
STDIN.each do |line|
|
||||
if line =~ /\.([^ ]*) ([^ ]*)\]' measured \[Time, seconds\] average: ([\d.]+)/
|
||||
if line =~ /\.([^ ]*) ([^ ]*)\]' measured \[.*\] average: ([\d.]+)/
|
||||
class_name = $1
|
||||
test_name = $2
|
||||
time = $3
|
||||
|
||||
Reference in new issue
Block a user