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

Github resolver is slow #160

Open
spmason opened this issue May 17, 2013 · 3 comments
Open

Github resolver is slow #160

spmason opened this issue May 17, 2013 · 3 comments
Milestone

Comments

@spmason
Copy link

spmason commented May 17, 2013

I'm seeing much slowness in volo, and through liberal use of console.time I've narrowed it down to the github resolver:

github resolve jrburke/requirejs/2.1.6: 546ms
github resolve jquery/jquery/1.7.2: 1479ms

Any ideas on how to speed this up?

@jrburke
Copy link
Member

jrburke commented Jun 5, 2013

It does the following right now for a github ID like jrburke/requirejs/2.1.6:

  • API call to get list of tags for the repo, since some repos use 'v2.1.6' tag names instead of just plain '2.1.6', so volo inspects the tags to find out if it should use a 'v' prefix.
  • Looks for a package.json with a "volo" section, in case the add target has dependencies
    • Fetches versionTag's package.json from github.
    • If that does not exist or no volo info in it, fetch master's package.json.
    • If still no volo info, check the volojs/repos override repo for an explicit package.json override.
  • If there is a volo.url property, confirm its target exists via a HEAD request.

In your examples, the requirejs one is quicker because it has a package.json with a volo property for the given tag, where jquery does not. So, in general, things will get quicker if more projects add a "volo" property to their package.json. In the meantime, the slowness is a tradeoff for not requiring all projects to buy into volo right away, but still allow them to be usable.

I am open to trying other things though. In particular, I can see perhaps discarding the master package.json check and just rely on the tagged version or the overrides directory. Will need to think about it a bit more, going to move this to 3.0.1 which has some other tickets for possible speed ups.

@spmason
Copy link
Author

spmason commented Jun 6, 2013

What about cloning the actual gh repo locally and doing the checks on that? It may be a bigger one-time hit but then subsequent actions would be a lot faster (including getting the actual code when necessary). You would also get implicit 'caching' for free..

Failing that, some other kind of local cache for api responses maybe?

@jrburke
Copy link
Member

jrburke commented Jun 6, 2013

A local cache is planned, tracking in #114. No plans to do git clones though.

@jrburke jrburke modified the milestones: 0.4.0, 0.3.2 May 28, 2014
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