// // Copyright (c) 2021 Open Whisper Systems. All rights reserved. // 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) { writeThreadAndInteractions() } } func writeThreadAndInteractions() { let threadFactory = ContactThreadFactory() threadFactory.messageCount = interactionCount write { transaction in self.startMeasuring() for _ in 0..