diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-05-15 12:34:57 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-05-15 12:34:57 +0300 |
| commit | ae36f44de7b9adbfa56525dd0046311ea7181288 (patch) | |
| tree | 2cf714e28240204dd95e5b35bcde608d6f135d65 /benchmark_mini.py | |
| parent | 8d4fa3b038493df8f2b6108cef669d5434b1736e (diff) | |
Run formatter, add ruff config
Diffstat (limited to 'benchmark_mini.py')
| -rw-r--r-- | benchmark_mini.py | 6 |
1 files changed, 5 insertions, 1 deletions
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) |
