From ae36f44de7b9adbfa56525dd0046311ea7181288 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 15 May 2025 12:34:57 +0300 Subject: Run formatter, add ruff config --- benchmark_mini.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'benchmark_mini.py') diff --git a/benchmark_mini.py b/benchmark_mini.py index 273b88b..c7ed63a 100644 --- a/benchmark_mini.py +++ b/benchmark_mini.py @@ -3,6 +3,7 @@ import tempfile import shutil from femtoqueue import FemtoQueue + def benchmark_femtoqueue(num_tasks: int = 1000): tmpdir = tempfile.mkdtemp() queue = FemtoQueue(data_dir=tmpdir, node_id="node1") @@ -26,9 +27,12 @@ def benchmark_femtoqueue(num_tasks: int = 1000): queue.done(task) processed += 1 process_duration = time.time() - start - print(f"Processed in {process_duration:.4f}s ({processed / process_duration:.2f} tasks/sec)") + print( + f"Processed in {process_duration:.4f}s ({processed / process_duration:.2f} tasks/sec)" + ) shutil.rmtree(tmpdir) + if __name__ == "__main__": benchmark_femtoqueue(1000) -- cgit v1.3