From cefe352402b6e0d9b11ceaa5484c12e11c990859 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:01:59 +0900 Subject: [PATCH] add buffering for csv.writer --- mixnet/queuesim/simulation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixnet/queuesim/simulation.py b/mixnet/queuesim/simulation.py index 74abf02..98ec372 100644 --- a/mixnet/queuesim/simulation.py +++ b/mixnet/queuesim/simulation.py @@ -42,7 +42,7 @@ class Simulation: self.framework.spawn(self.__run_sender(sender)) # Open the output CSV file - with open(out_csv_path, "w", newline="") as f: + with open(out_csv_path, "w", newline="", buffering=8192) as f: # Use CSV writer which is less error-prone than manually writing rows to the file writer = csv.writer(f) # To count how many nodes have received each message