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

performance optimizations for big repos #1277

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

jung-kim
Copy link
Collaborator


Prevent full gitlog history from server to client and load only what is needed

Upon page load, client will make and API call to get list of git nodes. However, this call gets list of ALL nodes every time. i.e. if a pages is showing 300 nodes and user scrolls down asking for 25 more nodes, backend will return 325 nodes, not just the 25 nodes needed.

This is now fixed and backend will return only the nodes client needs.

Prevent redundant ref and node calculations per each /gitlog api call
One of the biggest performance hit for big repos was due to git refs calculations because ungit loads ALL

refs, local and remote branches and tags of it's history.

This is needed to some degree to display them in the branch drop down and etc, but there were some inefficiencies on logic that thinking these refs had valid nodes and did unnecessary calculations.

@jung-kim jung-kim mentioned this pull request Feb 14, 2020
Copy link
Collaborator

@campersau campersau left a comment

Choose a reason for hiding this comment

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

components/graph/graph.js Outdated Show resolved Hide resolved
}

setData(logEntry) {
this.title(logEntry.message.split('\n')[0]);
this.parents(logEntry.parents || []);
this.commitTime = logEntry.commitDate;
this.date = Date.parse(this.commitTime);
this.timestamp = logEntry.timestamp || Date.parse(this.commitTime);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the commitDate is already parsed on the server is the fallback here still required?

Suggested change
this.timestamp = logEntry.timestamp || Date.parse(this.commitTime);
this.timestamp = logEntry.timestamp;

Co-Authored-By: campersau <buchholz.bastian@googlemail.com>
@wmertens
Copy link
Contributor

I think this can be closed, see #1461

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.

None yet

3 participants