-
Notifications
You must be signed in to change notification settings - Fork 935
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
Rework EntryUploader to use promises intead of setTimeout #3386
base: main
Are you sure you want to change the base?
Conversation
Will this be backwards compatible for user without the phoenix change? |
@chrismccord as far as I can tell, EntryUploader is an internal API so there shouldn't be any compatibility issues. If there are compatibility issues I would actually expect them to be in the linked Phoenix PR. |
To be clear: You mean it requires the Phoenix PR to realize the optimizations or it requires the phoenix PR to work at all? |
It requires it to work at all. It will not work without the Phoenix PR because the Phoenix PR enables the most important part of it, the copyless socket sends. The upstream Phoenix code makes either two or three superfluous copies of the data depending on the transport used, and that PR makes it so that it makes zero superfluous copies. |
We would need the Phoenix PR to be backwards compatible but it's still not clear to me where the breaking change is happening on the Phoenix side. Can you clarify? Thanks! |
@chrismccord I tested the Phoenix PR but could not find a way in which it broke backwards compatibility, since it continues to pass all external API tests. But I'm not totally confident and I'd suggest also checking for yourself. |
Sorry for the back and forth, but I want to understand this statement:
If the Phoenix PR is supposed to be backwards compatible, then merging this and running on an old Phoenix should merely miss out on the optimizations, no? |
I'm really sorry for the confusion.
Does that clear it up? |
This requires phoenixframework/phoenix#5897 to work.
When combined with that PR, it allows the frontend to get properly bottlenecked on the server response speed when uploading large files with
live_file_upload
and a chunk_size of1_048_576
.Upload performance goes from 50MB/s to 110MB/s in my testing.
The default
chunk_size
of64_000
is way too low and probably needs to be increased in this repository, but I did not do that here.Cowboy works best for performance testing. Bandit is much slower than expected, for reasons I have yet to investigate.