batch commit
@@ -103,7 +103,7 @@ public class ProgramExecutorImpl implements ProgramExecutor {
contractVM.heap.arrays.commit();
commitVms.put(contractAddress, contractVM);
}
- if (prevStateRoot != null) {
+ //if (prevStateRoot != null) {
for (Map.Entry<String, VM> vmEntry : commitVms.entrySet()) {
String address = vmEntry.getKey();
VM vm = vmEntry.getValue();
@@ -122,7 +122,8 @@ public class ProgramExecutorImpl implements ProgramExecutor {
}
logTime("add contract state");
}
- }
+ commitVms.clear();
+ //}
repository.commit();
logTime("commit");
}
@@ -229,10 +230,10 @@ public class ProgramExecutorImpl implements ProgramExecutor {
if (vm == null) {
vm = VMFactory.createVM();
} else {
- vm.heap.objects.clearCache();
- vm.heap.arrays.clearCache();
- vm = new VM(vm.heap, vm.methodArea);
- //vm = VMFactory.createVM();
+ //vm.heap.objects.clearCache();
+ //vm.heap.arrays.clearCache();
+ //vm = new VM(vm.heap, vm.methodArea);
+ vm = VMFactory.createVM();
}
vmCache.put(contractAddress, vm);
}
