Files
swift-composable-architectu…/Sources/swift-composable-architecture-benchmark/ViewStore.swift
Stephen Celis 767231d179 Add Store.init that takes reducer builder (#2087)
* Add `Store.init` that takes reducer builder

* wip

* wip

* added some tests

* wip

* wip

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2023-05-11 12:30:08 -07:00

19 lines
439 B
Swift

import Benchmark
import Combine
import ComposableArchitecture
import Foundation
let viewStoreSuite = BenchmarkSuite(name: "ViewStore") {
let store = Store<Int, Void>(initialState: 0) {}
$0.benchmark("Create view store to send action") {
doNotOptimizeAway(ViewStore(store).send(()))
}
let viewStore = ViewStore(store)
$0.benchmark("Send action to pre-created view store") {
doNotOptimizeAway(viewStore.send(()))
}
}