Skip to content

Commit

Permalink
fixing benchmark.py to work with new updates
Browse files Browse the repository at this point in the history
include patch_copyfile so it works with updates to speedcopy
  • Loading branch information
antirotor authored Jun 13, 2019
1 parent 5c19823 commit cc97604
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def generate_file(parent_dir, size_b):
try:
dir = sys.argv[1]
except:
print("pass destination directory as an argument if you want")
dir = None

with tempfile.TemporaryDirectory(dir=dir) as tmp_dir:
Expand All @@ -36,7 +37,7 @@ def generate_file(parent_dir, size_b):
for use_fast_copy in (False, True):
print(">>> with%s speedcopy ..." % ("" if use_fast_copy else "out"))
v = timeit.repeat(
setup=("import shutil; import speedcopy; "
setup=("import shutil; import speedcopy; speedcopy.patch_copyfile(); "
"p1 = {}; p2 = {}").format(repr(src), repr(dst)),
stmt="shutil.{}(p1, p2)".format(
"copyfile" if use_fast_copy else "_orig_copyfile"),
Expand Down

0 comments on commit cc97604

Please sign in to comment.