HomePhabricator
Diffusion Comm 9c9ba68db064

[services][blob] Avoid copying data chunks

Description

[services][blob] Avoid copying data chunks

Summary:
Resolves ENG-2372
Follow up: https://phab.comm.dev/D5728?id=18851#inline-38316

I could directly use | std::mem::take but my version also maintains initial capacity to avoid reallocatig. I consider this reasonable, as our current chunks will always be between 5-8 MiB (see https://phab.comm.dev/D5703?id=18815#inline-38279)

However, I can just use std::mem::take if requested.

Test Plan:

  • Added unit test for this function
  • Service Put endpoint still works as expected

Reviewers: varun, tomek, jon

Reviewed By: varun, tomek, jon

Subscribers: ashoat, atul

Differential Revision: https://phab.comm.dev/D5806

Details

Provenance
bartekAuthored on Dec 2 2022, 12:37 AM
Reviewer
varun
Differential Revision
D5806: [services][blob] Avoid copying data chunks
Parents
rCOMM812f339aefe6: [services][blob] Use S3 abstraction in service
Branches
Unknown
Tags
Unknown