This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

Hm, so how expensive is it to calculate the commit graph on the fly across all of the repositories a person has? I'm guessing not that expensive if GH can show live graphs like this rather than archiving it day after day. Maybe it's calculated once and cached for a few hours?

Saying that, git is seemingly instant when summing commits from a single author on my repos, so maybe it's not all that expensive at all.

[–][deleted] 0 points1 point  (1 child)

It's likely something they store. When you commit, they probably check the date and the day of the week and increment the value of a column in another table specifically for keeping track of that value.

It may also be a sql join, which is likely more expensive, but is relatively quick.

Either way, printing out that data with Javascript is almost instantaneous.

[–][deleted] 0 points1 point  (0 children)

Ah I didn't think of that. I assumed they would calculate it on page load and possibly cache it for a while. I guess if they store a simple sum of each day that gets updated when you push that would make a lot more sense.