Conversation
| if np.max(audio) > 0: | ||
| return True | ||
| else: | ||
| return False |
There was a problem hiding this comment.
@bmcfee do you know a way to ignore measurements when using timeit?
There was a problem hiding this comment.
Hrm, never thought about it; not seeing an obvious workaround in the timeit API.
There was a problem hiding this comment.
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.
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.
Thanks Jan. Will have some time this weekend to finish this up
using
timeitto address smoothing out the variance between individual file loadings.