Skip to content

Partial writes repeatedly shift buffered output #563

Description

@HDauven

zio::Writer::dump removes each successful partial write with Vec::drain. That shifts the remaining buffered output every time, making small downstream writes increasingly expensive.

With 1 MiB of incompressible input, a writer accepting one byte at a time takes about 109 ms. Keeping an offset into the existing buffer reduces that to about 4.5 ms, while an unlimited writer remains unchanged at about 3.56 ms. Memory use is unchanged.

The existing TODO above dump already points toward managing the buffer without drain.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions