From c36dcdc585303da01e0e924cb295fe65876e98f9 Mon Sep 17 00:00:00 2001 From: Florian Pinault Date: Tue, 5 Dec 2023 12:10:08 +0000 Subject: [PATCH] up --- scripts/speed-test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/speed-test.py b/scripts/speed-test.py index f24c745..b9ec5ea 100755 --- a/scripts/speed-test.py +++ b/scripts/speed-test.py @@ -8,6 +8,8 @@ from ecml_tools.data import open_dataset +VERSION = 1 + def main(): """Speed test for opening a dataset""" @@ -79,9 +81,9 @@ def show(start, count, bytes=""): end = time.time() if bytes: bytes = bytes / (end - start) - bytes = "(" + to_human_readable_bytes(bytes) + "/second)" + bytes = "(" + to_human_readable_bytes(bytes) + "/s)" print( - f"Opening {count} items took {to_human_readable(end - start)} ({count / (end - start) :.2f} items per second) {bytes}" + f"Opening {count} items took {to_human_readable(end - start)}. Items per seconds: {count / (end - start) :.2f} {bytes}" ) start = time.time() @@ -107,6 +109,7 @@ def process_item(ind): print( f"Each item has shape {shape} and dtype {dtype}, total {size} values, total {to_human_readable_bytes(size_bytes)}" ) + print("Speed test version:", VERSION) show(start, args.count, bytes=size_bytes * args.count)