On 9/13/22 05:16, Jan Sikorski (@jsikorski) wrote:
Maybe it makes sense to go one step further and only allocate a max(size - offset) buffer? If I understand correctly, as it stands, we'd still allocate 128MiB if the upload is between two large buffers and ranges only hit a small part at the end? That said, I guess it's not a thing that happens commonly, so I'm not blocking this patch.
Yes, there's definitely room for further improvement. It wasn't immediately clear what the best way was, though, and this was enough for now...