RectangleSelection up to 150-200 lines slow
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- csharp
- 領域
- desktop, performance
調査の方向性
ICSharpCode.AvalonEdit.Editing の Selection.SetEndpoint から始め、Alt、Shift、Down を使って 1,000 行で遅延を再現します。矩形選択に対して CalculateSegments がどのように呼び出されるかを調べます。選択範囲が既存の動作との一貫性を保ち、150~200 行付近での段階的な遅延を回避できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
hi, sorry for english but i use a translator. i tried for two days to speed up the management of the rectangular selection but without success, you can replicate the problem as follows: paste a text of 1000 lines, press and hold ALT and also hold down shift and the down arrow, to create a rectangular selection, go down until the program slows down around the 150-200 line. I tracked down the source of the problem and it is this:
public override Selection SetEndpoint(TextViewPosition endPosition)
in ICSharpCode.AvalonEdit.Editing
basically as it is designed every time you go down a line it calls
void CalculateSegments()
for all the lines
this means that at the 10th line the calculation it will do will be 10 lines, at the 150th line it will have to recalculate 150 lines, so the more you go down the slower the selection becomes, I tried with the following code to change the individual segments of the selection with excellent results in terms of speed but terrible in terms of consistency with everything else, is there any way to do it?
void CalculateSegmentsExists(TextViewPosition endPosition, int previousEndLine)
{
for (int i = 0; i < segments.Count; i++) {
SelectionSegment item = segments[i];
DocumentLine myLine = textArea.Document.GetLineByOffset(item.EndOffset);
int NewVC = endPosition.VisualColumn - item.EndVisualColumn;
TextViewPosition textViewPosition = new TextViewPosition(myLine.LineNumber, endPosition.VisualColumn);
if (myLine.Length < textViewPosition.Location.Column) {
NewVC = 0;
}
segments[i] = new SelectionSegment(item.StartOffset, item.StartVisualColumn, item.EndOffset + NewVC, endPosition.VisualColumn);
}
if (endPosition.Line > previousEndLine) {
for (int i = previousEndLine + 1; i <= endPosition.Line; i++) {
VisualLine vl = textArea.TextView.GetOrConstructVisualLine(nextLine);
int startVC = vl.GetVisualColumn(new Point(startXPos, 0), true);
int endVC = vl.GetVisualColumn(new Point(endXPos, 0), true);
int baseOffset = vl.FirstDocumentLine.Offset;
int startOffset = baseOffset + vl.GetRelativeOffset(startVC);
int endOffset = baseOffset + vl.GetRelativeOffset(endVC);
segments.Add(new SelectionSegment(startOffset, startVC, endOffset, endVC));
}
}
}
what I thought is: instead of recreating the rectangular selection every time if there was a way to do some sort of update maybe it would be faster, the problem is that I'm faced with too many things that remain unaligned
- 主要言語
- C#
- スター
- 2.1k
- フォーク
- 496
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
icsharpcode/AvalonEdit のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
icsharpcode/AvalonEdit#454 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
icsharpcode/AvalonEdit#449 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
icsharpcode/AvalonEdit#446 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
icsharpcode/AvalonEdit#445 · コメント 1 件 ·
-
Context menu ApplicationCommands.Cut still enabled when IsReadOnly = true対応中かも @JyslaFancy が 162 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
icsharpcode/AvalonEdit#444 ·
icsharpcode/AvalonEdit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
umbraco/Umbraco.Automate#612 ·
メンテナーはふだん 1 日以内に返信
-
崩溃日志只按 CRLF 分行オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PCL-Community/PCL-CE#3872 ·
メンテナーはふだん 1 日以内に返信
-
type:task ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elsa-workflows/elsa-foundation#5253 ·
メンテナーはふだん 1 日以内に返信