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

Optimize delta generation (in speed and size) #299

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 12, 2023

  1. Use optimal block length to generate deltas

    Previously, we used a block length hardcoded to 512 bytes. Our
    measurements have shown that this value was generally inadequate: it
    produced relatively large deltas and took relatively long times to do
    that.
    
    librsync, by default, uses block length equals to the square root of the
    old (basis) file (and a minimum of 256). This value results in
    significantly smaller deltas and shorter run times.
    
    In this commit, we do one more optimization and round this value up to
    the next power of two value. Since librsync-go has a code path optimized
    for buffers with sizes that are powers of two, this gives us another
    performance gain.
    lmbarros committed Jun 12, 2023
    Configuration menu
    Copy the full SHA
    c725494 View commit details
    Browse the repository at this point in the history