// // Copyright 2019 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only // import Foundation import XCTest import SignalServiceKit class ThreadPerformanceTest: PerformanceBaseTest { let threadCount = DebugFlags.fastPerfTests ? 2 : 10 let interactionCount: UInt = DebugFlags.fastPerfTests ? 5 : 100 // MARK: - writeThreadAndInteractions func testPerf_writeThreadAndInteractions() { measureMetrics(XCTestCase.defaultPerformanceMetrics, automaticallyStartMeasuring: false) { setUpIteration() writeThreadAndInteractions() } } func writeThreadAndInteractions() { let threadFactory = ContactThreadFactory() threadFactory.messageCount = interactionCount write { transaction in self.startMeasuring() for _ in 0..