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

Render revision graph in the background #11719

Merged
merged 5 commits into from May 12, 2024
Merged

Conversation

mstv
Copy link
Member

@mstv mstv commented May 1, 2024

Fixes #11700

Proposed changes

Have clear chains of revision grid updates (one for graph loading affecting RowCount, one for visible row range).
Get rid of several workarounds and of the mix-up of revision loading and graph-only operations.
Avoid unnecessary blocking the UI thread.

  • Do not render the graph in the UI thread but in a background task with double buffering
    in order to avoid calling the potentially expensive RevisionGraphRow.BuildSegmentLanes from the UI thread
  • Remove RevisionDataGridView.UpdateGraphAsync, just call RevisionGraph.CacheTo once with cancellation
    because CacheTo is needed for graph rendering only
  • Remove UpdateVisibleRowRange call on unhandled OnCellPainting
    because there no need to for this additional trigger of graph update
  • RevisionDataGridView: Remove special OnScroll handler which called Update from time to time
    because the revision graph rendering does not block the UI any longer

Screenshots

N/A

Test methodology

  • manual
  • adapted tests

Merge strategy

Please do not squash merge!


✒️ I contribute this code under The Developer Certificate of Origin.

@gerhardol
Copy link
Member

This seem to work OK, have not reviewed all details

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 seem to work well, no obvious comments in the review
It is hard to review though, it is hard to understand why changes are done, what is better, how this is an improvement.

@mstv mstv changed the title Draft: Render revision graph in the background Render revision graph in the background May 11, 2024
@mstv
Copy link
Member Author

mstv commented May 11, 2024

It is hard to review though, it is hard to understand why changes are done, what is better, how this is an improvement.

Yes, this was missing in the description. Updated.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

}
}

private void RenderGraphToCache(int rowIndex, int rowHeight)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private void RenderGraphToCache(int rowIndex, int rowHeight)
private void RenderRowToCache(int rowIndex, int rowHeight)

@mstv mstv merged commit a340186 into gitextensions:master May 12, 2024
3 of 4 checks passed
@mstv mstv deleted the fix/graph_perf branch May 12, 2024 19:58
@RussKie RussKie added this to the vNext milestone May 21, 2024
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.

Revision graph broken (regression)
3 participants