-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First draft of timeit loading #13
base: master
Are you sure you want to change the base?
Conversation
if np.max(audio) > 0: | ||
return True | ||
else: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmcfee do you know a way to ignore measurements when using timeit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm, never thought about it; not seeing an obvious workaround in the timeit API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so I guess the only alternative then it is to do a dry run in the beginning to just check if functions return of valid output for a given test file...
@bmcfee started this with just the numpy benchmark, maybe you could help me on this (i invited you to the repo) |
for fp in dataset.audio_files: | ||
time = timeit.timeit( | ||
functools.partial(test_np_loading, fp, lib), | ||
number=10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you're iterating over the files, loading each one 10 times in a row, then storing the time it took to load the last file 10 times. I think you'd want to divide the return value by 10, and accumulate the time over all files? Also you may want to use timeit.repeat()
to run 3 repetitions and then keep the smallest one, if the idea was to factor out disk I/O.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jan. Will have some time this weekend to finish this up
using
timeit
to address smoothing out the variance between individual file loadings.