libgit2 / libgit2/libgit2sharp

Diff compare with DiffTargets.WorkingDirectory is terribly slow

オープン
#2,010 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

Reproduction steps

Compare commit to the working tree directory on a relatively big repository

 repository.Diff.Compare<TreeChanges>(
              repository.Head.Tip.Tree,
              DiffTargets.WorkingDirectory)

which takes a long time or never completes. Comparing the working trees of two commits works instantly

                    var branchDiffResult = repository.Diff.Compare<TreeChanges>(
                       targetCommit.Tree,
                        repository.Head.Tip.Tree,
                        compareOptions);

Additionally, doing repository.RetrieveStatus() is also slow, but not that slow.

Expected behavior

The speed of the two matches.

Actual behavior

Comparing to working directory is terribly slow.

Version of LibGit2Sharp (release number or SHA1)

0.27.0.0

Operating system(s) tested; .NET runtime tested

4.72, windows 11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

比較的大きなリポジトリで repository.Diff.Compare(repository.Head.Tip.Tree, DiffTargets.WorkingDirectory) を使って低速化を再現し、その後、commit-to-commit オーバーロードおよび repository.RetrieveStatus() と比較します。作業ディレクトリの比較パスを追跡し、どこで時間が費やされているかを測定します。作業ディレクトリの比較が commit-to-commit 比較と同等のパフォーマンスで完了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, git
領域
backend-api-design, performance
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。