mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Do not measure database access acquisition and Array building
This commit is contained in:
1 parent
1ff66c8382
commit
e37c7cf306
1 file changed
+16
-8
@@ -41,11 +41,15 @@ class FetchStringTests: XCTestCase {
|
||||
|
||||
func test_record_fetch_performance() throws {
|
||||
let dbQueue = try makePersonDatabase()
|
||||
measure {
|
||||
try! dbQueue.read { db in
|
||||
try dbQueue.read { db in
|
||||
measure {
|
||||
for _ in 0..<Self.recordFetchesPerIteration {
|
||||
let people = try Person.fetchAll(db)
|
||||
XCTAssertEqual(people.count, Self.personRowCount)
|
||||
let people = try! Person.fetchCursor(db)
|
||||
var count = 0
|
||||
while try! people.next() != nil {
|
||||
count += 1
|
||||
}
|
||||
XCTAssertEqual(count, Self.personRowCount)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,11 +60,15 @@ class FetchStringTests: XCTestCase {
|
||||
from column: String) throws
|
||||
{
|
||||
let dbQueue = try makeDatabaseQueue()
|
||||
measure {
|
||||
try! dbQueue.read { db in
|
||||
try dbQueue.read { db in
|
||||
measure {
|
||||
for _ in 0..<Self.fetchesPerIteration {
|
||||
let values = try Value.fetchAll(db, sql: "SELECT \(column) FROM item")
|
||||
XCTAssertEqual(values.count, Self.expectedRowCount)
|
||||
let values = try! Value.fetchCursor(db, sql: "SELECT \(column) FROM item")
|
||||
var count = 0
|
||||
while try! values.next() != nil {
|
||||
count += 1
|
||||
}
|
||||
XCTAssertEqual(count, Self.expectedRowCount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user