From 0c9de25a8ca899f8abe1def71e259920de338bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Nov 2021 15:36:03 +0100 Subject: [PATCH] Bump number of operations performed by performance tests Apple Silicon and SSD are too fast, and we need to display higher numbers --- .../FetchNamedValuesTests.swift | 2 +- .../FetchPositionalValuesTests.swift | 2 +- .../FetchRecordClassTests.swift | 2 +- .../FetchRecordDecodableTests.swift | 2 +- .../FetchRecordOptimizedTests.swift | 2 +- .../FetchRecordStructTests.swift | 2 +- .../InsertNamedValuesTests.swift | 2 +- .../InsertPositionalValuesTests.swift | 2 +- .../InsertRecordClassTests.swift | 2 +- .../InsertRecordEncodableTests.swift | 2 +- .../InsertRecordOptimizedTests.swift | 2 +- .../InsertRecordStructTests.swift | 2 +- Tests/generatePerformanceReport.rb | 20 +++++++++---------- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Tests/Performance/GRDBPerformance/FetchNamedValuesTests.swift b/Tests/Performance/GRDBPerformance/FetchNamedValuesTests.swift index 31accf5c2..91edbada0 100644 --- a/Tests/Performance/GRDBPerformance/FetchNamedValuesTests.swift +++ b/Tests/Performance/GRDBPerformance/FetchNamedValuesTests.swift @@ -4,7 +4,7 @@ import GRDB import SQLite #endif -private let expectedRowCount = 100_000 +private let expectedRowCount = 200_000 /// Here we test the extraction of row values by column name. class FetchNamedValuesTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/FetchPositionalValuesTests.swift b/Tests/Performance/GRDBPerformance/FetchPositionalValuesTests.swift index 216a4e07c..90f39ded9 100644 --- a/Tests/Performance/GRDBPerformance/FetchPositionalValuesTests.swift +++ b/Tests/Performance/GRDBPerformance/FetchPositionalValuesTests.swift @@ -4,7 +4,7 @@ import GRDB import SQLite #endif -private let expectedRowCount = 100_000 +private let expectedRowCount = 200_000 /// Here we test the extraction of row values by column index. class FetchPositionalValuesTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/FetchRecordClassTests.swift b/Tests/Performance/GRDBPerformance/FetchRecordClassTests.swift index 96257b0d6..b2a13dbdb 100644 --- a/Tests/Performance/GRDBPerformance/FetchRecordClassTests.swift +++ b/Tests/Performance/GRDBPerformance/FetchRecordClassTests.swift @@ -5,7 +5,7 @@ import CoreData import RealmSwift #endif -private let expectedRowCount = 100_000 +private let expectedRowCount = 200_000 /// Here we test the extraction of model objects able to tell if they were /// modified since last fetched from the database. diff --git a/Tests/Performance/GRDBPerformance/FetchRecordDecodableTests.swift b/Tests/Performance/GRDBPerformance/FetchRecordDecodableTests.swift index 1deb6f675..03e9c7aaa 100644 --- a/Tests/Performance/GRDBPerformance/FetchRecordDecodableTests.swift +++ b/Tests/Performance/GRDBPerformance/FetchRecordDecodableTests.swift @@ -1,7 +1,7 @@ import XCTest import GRDB -private let expectedRowCount = 100_000 +private let expectedRowCount = 200_000 /// Here we test the extraction of Decodable GRDB records. class FetchRecordDecodableTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/FetchRecordOptimizedTests.swift b/Tests/Performance/GRDBPerformance/FetchRecordOptimizedTests.swift index db6d4c14d..9921c19d8 100644 --- a/Tests/Performance/GRDBPerformance/FetchRecordOptimizedTests.swift +++ b/Tests/Performance/GRDBPerformance/FetchRecordOptimizedTests.swift @@ -1,7 +1,7 @@ import XCTest import GRDB -private let expectedRowCount = 100_000 +private let expectedRowCount = 200_000 /// A record optimized for fetching performance private struct Item: Codable, FetchableRecord, PersistableRecord { diff --git a/Tests/Performance/GRDBPerformance/FetchRecordStructTests.swift b/Tests/Performance/GRDBPerformance/FetchRecordStructTests.swift index 7b78b61b7..a8b734954 100644 --- a/Tests/Performance/GRDBPerformance/FetchRecordStructTests.swift +++ b/Tests/Performance/GRDBPerformance/FetchRecordStructTests.swift @@ -4,7 +4,7 @@ import GRDB import SQLite #endif -private let expectedRowCount = 100_000 +private let expectedRowCount = 200_000 private struct Item { var i0: Int diff --git a/Tests/Performance/GRDBPerformance/InsertNamedValuesTests.swift b/Tests/Performance/GRDBPerformance/InsertNamedValuesTests.swift index b0e321b7b..bb607db7c 100644 --- a/Tests/Performance/GRDBPerformance/InsertNamedValuesTests.swift +++ b/Tests/Performance/GRDBPerformance/InsertNamedValuesTests.swift @@ -4,7 +4,7 @@ import GRDB import SQLite #endif -private let insertedRowCount = 20_000 +private let insertedRowCount = 50_000 // Here we insert rows, referencing statement arguments by name. class InsertNamedValuesTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/InsertPositionalValuesTests.swift b/Tests/Performance/GRDBPerformance/InsertPositionalValuesTests.swift index e3bd97873..382c6b516 100644 --- a/Tests/Performance/GRDBPerformance/InsertPositionalValuesTests.swift +++ b/Tests/Performance/GRDBPerformance/InsertPositionalValuesTests.swift @@ -4,7 +4,7 @@ import GRDB import SQLite #endif -private let insertedRowCount = 20_000 +private let insertedRowCount = 50_000 // Here we insert rows, referencing statement arguments by index. class InsertPositionalValuesTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/InsertRecordClassTests.swift b/Tests/Performance/GRDBPerformance/InsertRecordClassTests.swift index a936c8838..1bd3349c6 100644 --- a/Tests/Performance/GRDBPerformance/InsertRecordClassTests.swift +++ b/Tests/Performance/GRDBPerformance/InsertRecordClassTests.swift @@ -5,7 +5,7 @@ import CoreData import RealmSwift #endif -private let insertedRowCount = 20_000 +private let insertedRowCount = 50_000 // Here we insert record classes. class InsertRecordClassTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/InsertRecordEncodableTests.swift b/Tests/Performance/GRDBPerformance/InsertRecordEncodableTests.swift index 7879f133a..479b966af 100644 --- a/Tests/Performance/GRDBPerformance/InsertRecordEncodableTests.swift +++ b/Tests/Performance/GRDBPerformance/InsertRecordEncodableTests.swift @@ -1,7 +1,7 @@ import XCTest import GRDB -private let insertedRowCount = 20_000 +private let insertedRowCount = 50_000 // Here we insert records. class InsertRecordEncodableTests: XCTestCase { diff --git a/Tests/Performance/GRDBPerformance/InsertRecordOptimizedTests.swift b/Tests/Performance/GRDBPerformance/InsertRecordOptimizedTests.swift index 9735b512c..b0bf10bce 100644 --- a/Tests/Performance/GRDBPerformance/InsertRecordOptimizedTests.swift +++ b/Tests/Performance/GRDBPerformance/InsertRecordOptimizedTests.swift @@ -1,7 +1,7 @@ import XCTest import GRDB -private let insertedRowCount = 20_000 +private let insertedRowCount = 50_000 /// A record optimized for batch insert performance private struct Item: Codable, FetchableRecord, PersistableRecord { diff --git a/Tests/Performance/GRDBPerformance/InsertRecordStructTests.swift b/Tests/Performance/GRDBPerformance/InsertRecordStructTests.swift index 3a055537d..b94e2d584 100644 --- a/Tests/Performance/GRDBPerformance/InsertRecordStructTests.swift +++ b/Tests/Performance/GRDBPerformance/InsertRecordStructTests.swift @@ -1,7 +1,7 @@ import XCTest import GRDB -private let insertedRowCount = 20_000 +private let insertedRowCount = 50_000 // Here we insert records. class InsertRecordStructTests: XCTestCase { diff --git a/Tests/generatePerformanceReport.rb b/Tests/generatePerformanceReport.rb index 1dcb8cd83..0b542aed2 100755 --- a/Tests/generatePerformanceReport.rb +++ b/Tests/generatePerformanceReport.rb @@ -115,13 +115,13 @@ As a bottom line, the raw SQLite C API is used as efficiently as possible, witho - **Fetch** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/FetchPositionalValuesTests.swift)) - This test fetches 100000 rows of 10 ints and extracts each int given its position in the row. + This test fetches 200000 rows of 10 ints and extracts each int given its position in the row. It uses FMDB's `-[FMResultSet longForColumnIndex:]`, GRDB's `Row.value(atIndex:)`, and the low-level SQL API of SQLite.swift. - **Insert** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/InsertPositionalValuesTests.swift)) - This test inserts 20000 rows of 10 ints, by setting query arguments given their position. + This test inserts 50000 rows of 10 ints, by setting query arguments given their position. It uses FMDB's `-[FMDatabase executeUpdate:withArgumentsInArray:]` with statement caching, GRDB's `UpdateStatement.execute(arguments:Array)`, and the low-level SQL API of SQLite.swift. @@ -129,13 +129,13 @@ As a bottom line, the raw SQLite C API is used as efficiently as possible, witho - **Fetch** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/FetchNamedValuesTests.swift)) - This test fetches 100000 rows of 10 ints and extracts each int given its column name. + This test fetches 200000 rows of 10 ints and extracts each int given its column name. It uses FMDB's `-[FMResultSet longForColumn:]`, GRDB's `Row.value(named:)`, and the high-level query builder of SQLite.swift. - **Insert** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/InsertNamedValuesTests.swift)) - This test inserts 20000 rows of 10 ints, by setting query arguments given their argument name. + This test inserts 50000 rows of 10 ints, by setting query arguments given their argument name. It uses FMDB's `-[FMDatabase executeUpdate:withParameterDictionary:]` with statement caching, GRDB's `UpdateStatement.execute(arguments:Dictionary)`, and the high-level query builder of SQLite.swift. @@ -143,25 +143,25 @@ As a bottom line, the raw SQLite C API is used as efficiently as possible, witho - **Fetch** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/FetchRecordStructTests.swift)) - This test fetches an array of 100000 record objects initiated from rows of 10 ints. + This test fetches an array of 200000 record objects initiated from rows of 10 ints. It builds records from FMDB's `-[FMResultSet resultDictionary]`, GRDB's built-in [FetchableRecord](https://github.com/groue/GRDB.swift/blob/master/README.md#fetchablerecord-protocol) protocol, and the values returned by the high-level query builder of SQLite.swift. - **Insert** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/InsertRecordStructTests.swift)) - This tests inserts 20000 records with the persistence method provided by GRDB's [PersistableRecord](https://github.com/groue/GRDB.swift/blob/master/README.md#persistablerecord-protocol) protocol. + This tests inserts 50000 records with the persistence method provided by GRDB's [PersistableRecord](https://github.com/groue/GRDB.swift/blob/master/README.md#persistablerecord-protocol) protocol. - **Codable Records**: - **Fetch** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/FetchRecordDecodableTests.swift)) - This test fetches an array of 100000 record objects initiated from rows of 10 ints. + This test fetches an array of 200000 record objects initiated from rows of 10 ints. It builds records from GRDB's built-in support for the [Decodable standard protocols](https://github.com/groue/GRDB.swift/blob/master/README.md#codable-records). - **Insert** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/InsertRecordEncodableTests.swift)) - This tests inserts 20000 records with the persistence method provided by GRDB's built-in support for the [Encodable standard protocols](https://github.com/groue/GRDB.swift/blob/master/README.md#codable-records). + This tests inserts 50000 records with the persistence method provided by GRDB's built-in support for the [Encodable standard protocols](https://github.com/groue/GRDB.swift/blob/master/README.md#codable-records). - **Optimized Records**: @@ -177,11 +177,11 @@ As a bottom line, the raw SQLite C API is used as efficiently as possible, witho - **Fetch** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/FetchRecordClassTests.swift)) - This test fetches an array of 100000 record objects initiated from rows of 10 ints. + This test fetches an array of 200000 record objects initiated from rows of 10 ints. It builds records from FMDB's `-[FMResultSet resultDictionary]`, GRDB's built-in [Record](https://github.com/groue/GRDB.swift/blob/master/README.md#record-class) class. - **Insert** ([source](https://github.com/groue/GRDB.swift/blob/master/Tests/Performance/GRDBPerformance/InsertRecordClassTests.swift)) - This tests inserts 20000 records with the persistence method provided by GRDB's [Record](https://github.com/groue/GRDB.swift/blob/master/README.md#record-class) class. + This tests inserts 50000 records with the persistence method provided by GRDB's [Record](https://github.com/groue/GRDB.swift/blob/master/README.md#record-class) class. REPORT