Skip to content

Commit

Permalink
Fix HiveRunner not choosing laziness right
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Sep 24, 2019
1 parent 42d889d commit aa86812
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
4 changes: 2 additions & 2 deletions lib/benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Result {
final runners = [
HiveRunner(false),
HiveRunner(true),
// SqfliteRunner(),
// SharedPreferencesRunner(),
SqfliteRunner(),
SharedPreferencesRunner(),
MoorFfiRunner(),
];

Expand Down
4 changes: 2 additions & 2 deletions lib/runners/hive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class HiveRunner implements BenchmarkRunner {

@override
Future<int> batchWriteString(Map<String, dynamic> entries) async {
var box = await Hive.openBox('box', lazy: true);
var box = await Hive.openBox('box', lazy: lazy);
var s = Stopwatch()..start();
for (var key in entries.keys) {
await box.put(key, entries[key]);
Expand All @@ -68,7 +68,7 @@ class HiveRunner implements BenchmarkRunner {

@override
Future<int> batchDeleteInt(List<String> keys) async {
var box = await Hive.openBox('box', lazy: true);
var box = await Hive.openBox('box', lazy: lazy);
var s = Stopwatch()..start();
for (var key in keys) {
await box.delete(key);
Expand Down

0 comments on commit aa86812

Please sign in to comment.