Skip to content

Add viewport intersection check to cull invisible GraphView edges#3619

Merged
PremadeS merged 9 commits into
rizinorg:devfrom
andersendsa:draw_edges
Jul 2, 2026
Merged

Add viewport intersection check to cull invisible GraphView edges#3619
PremadeS merged 9 commits into
rizinorg:devfrom
andersendsa:draw_edges

Conversation

@andersendsa

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've updated the documentation with the relevant information (if needed)
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

Test plan (required)

  1. Open a large statically-linked binary in Cutter.
  2. Navigate to a complex function with hundreds of basic blocks and open the Graph View.
  3. Pan and zoom around the graph extensively.
  4. Correctness check: Verify that all edges entering or exiting the visible screen area are drawn correctly and no connecting lines are missing.
  5. Performance check: Observe the UI responsiveness; panning and zooming should feel smoother and consume less CPU, as off-screen edges are no longer being processed by the Qt painting engine.

Closing issues

@wargio

wargio commented Jun 13, 2026

Copy link
Copy Markdown
Member

normally we require for these a recording of before and after the fix, also what is the issue that is fixing?

@wargio
wargio requested a review from PremadeS June 13, 2026 15:59
@andersendsa

Copy link
Copy Markdown
Contributor Author

normally we require for these a recording of before and after the fix, also what is the issue that is fixing?

Hi @wargio this resolves a todo mentioned in the codebase

@andersendsa

Copy link
Copy Markdown
Contributor Author

Hi @PremadeS could you pls let me know if there any changes needed or if this pr is good to merge

@PremadeS PremadeS left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doesn't seem to be drawing all of the edges correctly

for example on the ls binary inside fcn.000065f0 function

Original: see the false/red and true/green "straight" arrows going to next blocks
Image

This PR: those arrows are no longer present, even though the edges/arrows are in the visible range

Image

Another one from a test binary of mine:
Original: see the true/green straight edge going from first block to next

Image

This PR: It's no longer present

Image

@PremadeS

PremadeS commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

From that single addition there seems to be an ~83.45% decrease in time taken (or ~6.04 times faster) for rendering entire graph view with around 7014 edges where ~8 edges are currently visible (8 visible edges is a realistic scenario) on my machine

That is assuming it draws all edges correctly

7014 edges in a graph view at once is highly unlikely in any realistic scenario, this was just to check the difference in performance if there happen to be ~7000 edges

Comment thread .github/workflows/ci.yml
@andersendsa

Copy link
Copy Markdown
Contributor Author

@PremadeS i reverted the changes the pr is ready for review

@andersendsa
andersendsa requested a review from PremadeS June 20, 2026 13:53
Comment thread cmake/BundledRizin.cmake Outdated

@PremadeS PremadeS left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Works fine, just need to update the comment :)

Comment thread src/widgets/GraphView.cpp Outdated
@andersendsa

Copy link
Copy Markdown
Contributor Author

Hi @PremadeS I have updated the comment the pr is ready for review

@andersendsa

Copy link
Copy Markdown
Contributor Author

Hi @PremadeS is this pr good to merge?

@PremadeS

PremadeS commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

@andersendsa could you please rebase?

sorry for not merging this sooner, was waiting for the 2.5 release

@andersendsa

Copy link
Copy Markdown
Contributor Author

Hi @PremadeS I have updated the base branch

@PremadeS
PremadeS merged commit 2c6c838 into rizinorg:dev Jul 2, 2026
15 checks passed
@andersendsa
andersendsa deleted the draw_edges branch July 2, 2026 08:41
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.

3 participants