Skip to content
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

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft

Conversation

faroit
Copy link
Owner

@faroit faroit commented Jul 22, 2020

using timeit to address smoothing out the variance between individual file loadings.

if np.max(audio) > 0:
return True
else:
return False
Copy link
Owner Author

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?

Copy link
Contributor

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.

Copy link
Owner Author

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...

@faroit
Copy link
Owner Author

faroit commented Jul 22, 2020

@bmcfee started this with just the numpy benchmark, maybe you could help me on this (i invited you to the repo)

@faroit faroit changed the title Tirst draft of timeit loading First draft of timeit loading Jul 22, 2020
Comment on lines +89 to +92
for fp in dataset.audio_files:
time = timeit.timeit(
functools.partial(test_np_loading, fp, lib),
number=10
Copy link

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.

Copy link
Owner Author

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

Base automatically changed from tf2_librosa7 to master September 6, 2021 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants