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

gitoxide progress bar fixes #11800

Merged
merged 2 commits into from
Mar 4, 2023
Merged

gitoxide progress bar fixes #11800

merged 2 commits into from
Mar 4, 2023

Commits on Mar 4, 2023

  1. Adjust git::fetch() progress bar to deal with gitoxide-specifics

    The `git2` implementation can leverage that `git2` provides a consistent
    view on the objects to be index, so it looks like 33% of the time is spent
    receiving objects, and the rest of the time is used resolving them.
    
    In `gitoxide`, there are two distinct phases and these are exposed by the way
    we obtain progress for two separate phases. We have to do some math to renormalize
    those to a single, continuous progress by mapping the values for 'amount of objects'
    to the first half and second half of the progress bar respectively.
    
    This has the advantage of having the first phase (receiving objects) end at 50%
    and the second phase (resolving deltas) at 100%.
    Byron committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    6e96095 View commit details
    Browse the repository at this point in the history
  2. Cool down progress loop.

    Previously it actually was very hot and needed an entire CPU for itself
    due to constant querying of progress information.
    
    Now it's slowed down by consistently sleeping for a short amount of time.
    
    This time should be short enough to not let the progress bar hold up the
    overall progress of the fetch operation, hence the 10ms sleep time,
    reducing the worst-case hold-up to 10ms.
    Byron committed Mar 4, 2023
    Configuration menu
    Copy the full SHA
    789efe3 View commit details
    Browse the repository at this point in the history