volojs / volo

Create front end projects from templates, add dependencies, and automate the resulting projects
https://volojs.github.io/
Other
1.41k stars 99 forks source link

Github resolver is slow #160

Open spmason opened 11 years ago

spmason commented 11 years ago

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 commented 11 years ago

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

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 commented 11 years ago

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 commented 11 years ago

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