tipsy/profile-summary-for-github

Star-check is slow

tipsy opened this issue · 3 comments

tipsy commented

Usually this isn't a problem, (since traffic is low these days), but it takes a long time to check if a user has starred the repo (seems to be about 1s per 100 stars the user has given). Should perhaps look at optimizing this. Any thoughts @iProdigy?

That PR will help a little but yeah we are currently requesting starred repos 100 at a time until we find our repo or there are no more pages left... worth investigating more optimal api usage

Edit: the speed limitations of this approach seem to be a limitation of the version of the github api org.eclipse.egit.github.core v2.1.5 provides...

tipsy commented

@iProdigy I made a fix (or a hack) in 3886d8e.

The code works like this:

  • On init, read all stars into memory
  • On call to hasStarredRepo, merge the last page of stars into memory, then find user.

I can think of some cases where this will fail, but not very realistic ones. Let me know if you think I overlooked something.

Should have some time in the upcoming days to review this