Skip to content
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

Optimise Flow.copy with Buf_read.as_flow #663

Merged
merged 2 commits into from
Jan 2, 2024

Commits on Jan 2, 2024

  1. Add Flow.copy benchmark

    talex5 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    fbe8a71 View commit details
    Browse the repository at this point in the history
  2. Optimise Flow.copy with Buf_read.as_flow

    By default, Flow.copy creates a 4KB buffer and copies the data through
    that. However, if the source of the copy is a buffered reader then it is
    much more efficient to use its buffer directly.
    
    This updates the flow you get from `Buf_read.as_flow` to offer this
    optimisation, and also updates the eio_posix backend's flow to use this
    optimisation when available (eio_linux already supported this).
    
    Detected in a benchmark by Leandro Ostera.
    talex5 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    19c43d7 View commit details
    Browse the repository at this point in the history