Skip to content

Avoid redundant content reads when opening a compare editor#2804

Draft
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:compare-redundant-reads
Draft

Avoid redundant content reads when opening a compare editor#2804
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:compare-redundant-reads

Conversation

@vogella

@vogella vogella commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Opening a compare editor read each side's contents up to 15 times: the content and structure switching panes looked the viewer descriptors up twice per pane, and every lookup re-ran content-type sniffing and the text heuristic against a fresh stream. The panes now cache the descriptor array computed while creating the viewer, and the sniffing results are memoized per element for the duration of one open, reset whenever a different input is examined. Each side is now read at most three times: once for content-type detection, once for the text heuristic, and once for the actual document; CompareOpenEfficiencyTest's bound tightens from 15 to 3 to lock the improvement in. Viewer selection is unchanged. For inputs whose streams are expensive to produce, such as EGit revisions that re-inflate the blob and re-run smudge filters on every read, this removes most of the I/O on the open path.

Contributes to #2795

Opening a compare editor read each side's contents up to 15 times: the
content and structure switching panes looked the viewer descriptors up
twice per pane, and every lookup re-ran content-type sniffing and the
text heuristic against a fresh stream. The panes now cache the
descriptor array computed while creating the viewer, and the sniffing
results are memoized per element for the duration of one open, keyed by
element identity and reset whenever a different input is examined. Each
side is now read at most three times: once for content-type detection,
once for the text heuristic, and once for the document shown in the
viewer. Viewer selection is unchanged.

Contributes to eclipse-platform#2795
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   58m 21s ⏱️ -37s
 4 685 tests ±0   4 662 ✅  - 1   22 💤 ±0  1 ❌ +1 
11 949 runs  ±0  11 795 ✅  - 1  153 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit b13fb21. ± Comparison against base commit 32aa15c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant