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

list virtual branches performance #4771

Merged
merged 11 commits into from
Aug 29, 2024
Merged

Commits on Aug 28, 2024

  1. Also debug-trace information on list_virtual_branches calls.

    This can be useful for those who seek extra information, and while it's
    dominating refresh times.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    dd724f3 View commit details
    Browse the repository at this point in the history
  2. Add branch status to CLI

    It calls `list_virtual_branches()` which kind of has the effect of a status call.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    30cc6a4 View commit details
    Browse the repository at this point in the history
  3. Allow the bench profile to compile faster

    There we don't necessarily need every last bit of optimization like
    one would want in release profiles, but build performance is of the essence
    for developer productivity.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    bd2c19d View commit details
    Browse the repository at this point in the history
  4. Use read-only worktree diff

    The worktree diff is essentially a 'git status' with a given tree,
    and that can be expressed with a diff of the workdir, the index and a tree.
    
    This comes at the expense of not being able to control which file sizes are diffed.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    7e0878a View commit details
    Browse the repository at this point in the history
  5. Add a flag to allow performance logging: GITBUTLER_PERFORMANCE_LOG

    ````
    GITBUTLER_PERFORMANCE_LOG=1 LOG_LEVEL=debug pnpm tauri dev
    ````
    
    Additionally, some noise was removed by turning a warning into
    a trace.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    fc63929 View commit details
    Browse the repository at this point in the history
  6. Do not dynamically calculate the head commit when listing virtual bra…

    …nches.
    
    That way, the head is static which allows to re-use the worktree status across
    multiple related calls.
    
    Also, add a way to quickly get the `head_commit()` from a `git2::Repository`.
    
    Note that this may cause breakage in the app, as now it will see the actual
    head, not a computed one, but that should also help us to find places that
    didn't properly update their state.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    7ce1439 View commit details
    Browse the repository at this point in the history
  7. find large files more quickly thanks to gix based dirwalk

    Also make sure that important `gix` crates are always compiled
    with optimization for proper performance.
    
    This is particularly useful when optimizing performance as not
    everything has to be done in release mode.
    
    However, it also causes CI to be slower as it compiles some
    dependencies longer.
    
    The problem realy is that `tauri dev` doesn't support custom profiles,
    so there is only `dev` and `release`.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    13deabd View commit details
    Browse the repository at this point in the history
  8. Reuse the worktree-diff during 'recalulate-everything'

    It's used for emission of changed files, but also for listing
    branch information.
    
    Make sure we only run the worktree-status once to save time.
    
    This also unifies the acquisition of the `HEAD^{commit}`,
    which one day will be a natural feature once `gix::Repository`
    is used.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    751e091 View commit details
    Browse the repository at this point in the history
  9. refactor

    - move `gix` repository extension to where it belongs more naturally.
    - make sure that `get_wd_tree()` is named more closely to what it really
      does, and use it in more places.
    Byron committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    a0e2361 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2024

  1. Exclude big files when performing a worktree diff.

    This was lost previously when switching it over to a read-only
    implementation.
    Implementing it with an ignore list will take time, 400ms in the GitLab
    repository, but it's not slower than it was before and it is always
    preferred to not dump objects into the ODB unnecessarily.
    Byron committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    79798c7 View commit details
    Browse the repository at this point in the history
  2. Keep using get_workspace_head() when no cached result is used.

    That way, the application will not run into unexpected cases.
    Byron committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    a7b01bd View commit details
    Browse the repository at this point in the history