Opening a compare editor blocks the UI and reads the input contents repeatedly
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- java
- 领域
- desktop, performance, testing-qa
调研方向
首先跟踪 org.eclipse.compare 中 compare-editor 的打开路径,包括 StorageTypedElement、CompareUIPlugin.canShowInUnifiedDiff 和 UnifiedDiffManager.open。先运行 issue 中描述的计数和计时测试。完成的标准是:测量涵盖重复读取和 UI 阻塞,移除冗余工作,并且 unified diff 和初始 diff 的处理遵循预期的后台作业模式。
由索引模型根据 Issue 内容生成。
描述
Opening a compare editor (for example from the Git History or Git Staging view) takes long, even for small files. The same applies to the new unified diff display.
Tracing the open path in org.eclipse.compare shows the delay is structural, not in the diff algorithm (see also #2575, where a DocLineComparator micro-optimization did not help):
- The input contents are read repeatedly during a single open. A new counting test measures 15
getContents()calls per side for one editor open. With EGit inputs each call re-inflates the blob sinceStorageTypedElementonly buffers the storage handle. - After the "Comparing..." job, everything else runs on the UI thread inside
createContents. Timing tests confirm time-to-text equals time-to-diff, so nothing is visible until the diff completes (about 190 ms for 5000 lines with 100 changes, about 310 ms for 50000 lines, measured on Linux/Xvfb). - With the unified diff preference enabled,
CompareUIPlugin.canShowInUnifiedDiffruns the fullprepareInputsynchronously on the UI thread with aNullProgressMonitor, builds a throwawayTextMergeVieweron an invisibleShell, andUnifiedDiffManager.openthen computes a second diff inline on the UI thread.
I plan to address this incrementally: measurable tests first (deterministic call counters plus repeated-run timing medians, since the old org.eclipse.test.performance-based tests assert nothing without the performance database), then removing the redundant lookups and reads, then moving the unified path onto the same background-job pattern as the classic editor, and finally making the initial diff asynchronous so the text shows immediately.
See also #121 for a related problem after the compare editor opens.
- 主要语言
- Java
- 星标
- 165
- 派生
- 174
- 平均合并
- 4 天 11 分钟
- 30 天内合并 PR
- 43
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eclipse-platform/eclipse.platform 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
eclipse-platform/eclipse.platform#3019 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
eclipse-platform/eclipse.platform#2940 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
eclipse-platform/eclipse.platform#2593 · 7 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 3/5 1-2 天 新手友好度 45/100
eclipse-platform/eclipse.platform#3027 ·
维护者通常 1 天内回复
-
JGit runtime logs are spamming debugger console可能已有人在做 @HannesWell 于 7 天前认领。 未关闭bug regression
难度 3/5 1-2 天 新手友好度 56/100
eclipse-platform/eclipse.platform#3022 · 18 条评论 ·
维护者通常 1 天内回复
查看 eclipse-platform/eclipse.platform 的全部 Issue
相似的 Issue
-
human-required sync-failed
难度 2/5 1-3 小时 新手友好度 68/100
Azure/osdu-spi-file#63 ·
维护者通常 1 天内回复
-
frontend quick win
难度 2/5 1-3 小时 新手友好度 65/100
CodeForPhilly/benefit-decision-toolkit#571 ·
维护者通常 1 天内回复
-
approved
难度 2/5 1-3 小时 新手友好度 67/100
checkstyle/checkstyle#22129 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Add Hardcharger JDBC driver可能已有人在做 @prmoore77 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复