Remove duplicate loading of commits on network graph

What does this MR do and why?

Remove duplicate loading of commits on network graph

#find_commits can be called twice in the same request with the exact same parameters and result, so this change ensures we serve the second result from the request cache in that instance.

This is caused by find_commits being called with the return value of count_to_display_commit_in_center, which also calls find_commits.

On https://gitlab.com/gitlab-org/gitlab/-/network/master?ref_type=heads this will save anywhere from 1.5-2.5 seconds from the render time.

Changelog: performance

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Current performance on https://gitlab.com/gitlab-org/gitlab/-/network/master?ref_type=heads

Screenshot_2023-07-25_at_15.46.02

GDK before

Screenshot_2023-07-25_at_15.53.45

GDK after

Screenshot_2023-07-25_at_15.53.17

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Robert May

Merge request reports

Loading