Skip to content

Commit cee3345

Browse files
Benchmark: cache Box for runInTransactionAsync (#19)
1 parent 31de197 commit cee3345

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

benchmark/bin/write.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ class RunInTxAsync extends DbBenchmark {
117117

118118
@override
119119
Future<void> runIteration(int iteration) {
120-
return store.runInTransactionAsync(
121-
TxMode.write,
122-
(Store store, List<TestEntity> items) =>
123-
items.forEach(store.box<TestEntity>().put),
124-
items);
120+
return store.runInTransactionAsync(TxMode.write,
121+
(Store store, List<TestEntity> items) {
122+
final box = store.box<TestEntity>();
123+
items.forEach(box.put);
124+
}, items);
125125
}
126126
}

0 commit comments

Comments
 (0)