-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
https://github.com/thelabcat/cookworm-c
In [37]: def ratio_test():
...: start = time.time()
...: p = subprocess.Popen(["bwparser"], stdin=subprocess.PIPE
⋮ , stdout=subprocess.PIPE, text=True)
...: coutraw, err = p.communicate(input=data)
...: p.kill()
...: cout = coutraw.strip().splitlines()
...: mark1 = time.time()
...: pout = cookworm.unpack_wordlist(data)
...: mark2 = time.time()
...: return (mark2 - mark1) / (mark1 - start)
...:
In [38]: sum([ratio_test() for i in range(50)]) / 50
Out[38]: 2.3839193407044785
So, even with Python handling, using the bwparser binary is around 2.38 x faster.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels