mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
23 lines
540 B
Swift
23 lines
540 B
Swift
import Benchmark
|
|
import Combine
|
|
import ComposableArchitecture
|
|
import Foundation
|
|
|
|
let viewStoreSuite = BenchmarkSuite(name: "ViewStore") {
|
|
let store = Store<Int, Void>(initialState: 0) {}
|
|
|
|
$0.benchmark("Send action to store") {
|
|
doNotOptimizeAway(store.send(()))
|
|
}
|
|
|
|
$0.benchmark("Create view store to send action") {
|
|
doNotOptimizeAway(ViewStore(store, observe: { $0 }).send(()))
|
|
}
|
|
|
|
let viewStore = ViewStore(store)
|
|
|
|
$0.benchmark("Send action to pre-created view store") {
|
|
doNotOptimizeAway(viewStore.send(()))
|
|
}
|
|
}
|