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
perf: Copy files instead of sending over HTTP if Wave app and Wave server are running on the same machine. #982 #1765
Conversation
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.
The implementation looks good.
However, because the implementation unconditionally resorts to copy-if-local, it's possible we might hit some unforeseen OS permissions/config where the copying might fail.
Possible safeguards are:
A. Fallback to HTTP if local copy fails (try-except).
B. Enable copy-if-local behavior only if an env var is set.
C. Enable copy-if-local by default, but allow disabling behavior if an env var is set (provides an escape hatch if existing installations get hosed).
Thoughts?
Thanks for the suggestions @lo5! A combination of A and C seems like the way to go for me. Will do. |
The PR is done.
@lo5 can you please let me know what you think about naming? ( |
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.
Names look fine. Minor changes to the docs.
…rver are running on the same machine. #982
Co-authored-by: Prithvi <prithvi.prabhu@gmail.com>
Co-authored-by: Prithvi <prithvi.prabhu@gmail.com>
6feaffc
to
1c05827
Compare
This is a rough proposal for further discussion. If approved, will finish the rest of the sync/async upload methods.
Rationale: When uploading files, we send them over HTTP with serialization/deserialization overhead that slows the whole method. However, most of the Wave apps run both Wave server (waved) and Wave app on the same machine which means a simple file copy should be enough.
Perf testing
HTTPX 0.16.1 is the original version from the time of creating issue #982.
Although we have public/private dirs, the concept of serving files and figuring out what is the correct URL can be troublesome for non-software engineering users so I would suggest keeping the current q.site.upload as is.
This change would impact most (if not all) Wave users who use
q.site.upload
.Wdyt @lo5?
Closes #982