// // Copyright (c) 2019 Open Whisper Systems. All rights reserved. // import Foundation import XCTest import SignalServiceKit class ThreadPerformanceTest: PerformanceBaseTest { let threadCount = 10 let interactionCount: UInt = 100 // MARK: - writeThreadAndInteractions func testYDBPerf_writeThreadAndInteractions() { storageCoordinator.useYDBForTests() measureMetrics(XCTestCase.defaultPerformanceMetrics, automaticallyStartMeasuring: false) { writeThreadAndInteractions() } } func testGRDBPerf_writeThreadAndInteractions() { storageCoordinator.useGRDBForTests() measureMetrics(XCTestCase.defaultPerformanceMetrics, automaticallyStartMeasuring: false) { writeThreadAndInteractions() } } func writeThreadAndInteractions() { let threadFactory = ContactThreadFactory() threadFactory.messageCount = interactionCount write { transaction in self.startMeasuring() for _ in 0..