Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Dec 5, 2023
1 parent c1282f5 commit c36dcdc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/speed-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from ecml_tools.data import open_dataset

VERSION = 1


def main():
"""Speed test for opening a dataset"""
Expand Down Expand Up @@ -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()
Expand All @@ -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)


Expand Down

0 comments on commit c36dcdc

Please sign in to comment.