refactor s3 submodule to minimize resource usage#569
Merged
Conversation
creating sessions and resources costs time and memory
$ time python benchmark/read_s3.py < benchmark/urls.txt real 1m20.786s user 0m8.619s sys 0m0.894s $ time python benchmark/read_s3.py create_session < benchmark/urls.txt real 1m45.826s user 0m4.554s sys 0m0.149s $ time python benchmark/read_s3.py create_resource < benchmark/urls.txt real 0m22.046s user 0m1.474s sys 0m0.065s $ time python benchmark/read_s3.py create_session_and_resource < benchmark/urls.txt real 0m21.086s user 0m1.496s sys 0m0.073s
piskvorky
requested changes
Dec 18, 2020
Co-authored-by: Radim Řehůřek <radimrehurek@seznam.cz>
piskvorky
requested changes
Dec 26, 2020
piskvorky
approved these changes
Dec 27, 2020
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating sessions and resources costs time and memory. If possible, smart_open should avoid creating resources by itself, and allow the user to specify them up front.
Here are some CPU-time benchmark results:
There are memory benefits as well, but I didn't benchmark them, because the CPU benchmarks were compelling enough.