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

Star-check is slow #87

Closed
tipsy opened this issue Apr 2, 2018 · 3 comments
Closed

Star-check is slow #87

tipsy opened this issue Apr 2, 2018 · 3 comments

Comments

@tipsy
Copy link
Owner

tipsy commented Apr 2, 2018

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?

@iProdigy
Copy link
Contributor

iProdigy commented Apr 2, 2018

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
Copy link
Owner Author

tipsy commented Apr 2, 2018

@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.

@tipsy tipsy changed the title star-check is slow Star-check is slow Apr 2, 2018
@iProdigy
Copy link
Contributor

iProdigy commented Apr 5, 2018

Should have some time in the upcoming days to review this

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

No branches or pull requests

2 participants