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

Would an async api have performance gain? #7

Open
npuichigo opened this issue Dec 8, 2023 · 2 comments
Open

Would an async api have performance gain? #7

npuichigo opened this issue Dec 8, 2023 · 2 comments

Comments

@npuichigo
Copy link

Fantastic job! But I'd like to ask if there would be some another gains by designing an async implementation and bind them to python with __anext__ and __aiter__, since data loading is highly related to IO.

@angeloskath
Copy link
Member

Thanks! I don't think asynchronous iteration would be helpful in our particular case.

Background fetching of the next sample or batch is achieved using the prefetch method. This leaves the python thread to process the batch while in the background other threads are fetching the next samples. If you have a particular use case that we might have missed which would benefit from python's asyncio then we 'd love to reevaluate.

@npuichigo
Copy link
Author

If we have a slow IO like remote cloud storage like S3, maybe it would block the prefetch thread pool?

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

No branches or pull requests

2 participants