We knew the new API could, in the worst case, do an additional copy (see TODOs in PR description and code.). Some quick experimentation showed this was the cause.
Add new poll_write() function, which is simpler to use from Mountpoint.
Mountpoint typically does 1MiB or 256KiB writes. So we pretty much always need to copy the data immediately. So let's optimize for that.
Rust needed tricky code to cope with the original write() API's demand that data stay alive until the write-future completes. And aws-c-s3 needed tricky code to guarantee cancel() would synchronously fire any pending write-futures. If we just offer a rust-polling-style API that always copies synchronously, we can simplify a lot of code. So let's do that.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue: Mountpoint's upload throughput took a 20% hit when they started using the new async write API (PR https://github.com/awslabs/aws-c-s3/pull/418).
We knew the new API could, in the worst case, do an additional copy (see TODOs in PR description and code.). Some quick experimentation showed this was the cause.
Description of changes:
poll_write()
function, which is simpler to use from Mountpoint.write()
API's demand that data stay alive until the write-future completes. And aws-c-s3 needed tricky code to guaranteecancel()
would synchronously fire any pending write-futures. If we just offer a rust-polling-style API that always copies synchronously, we can simplify a lot of code. So let's do that.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.