gitlabhq / grit

Grit gives you object oriented read/write access to Git repositories via Ruby. Patched for GitLab
gitlab.org
MIT License
59 stars 55 forks source link

further improving performance #2

Closed nathanvda closed 12 years ago

nathanvda commented 12 years ago

Further related to gitlab issue https://github.com/gitlabhq/gitlabhq/issues/842 : the counting is now much faster, but listing all the branches and tags (for the dropdown select) is still slow.

So what did I do: instead of creating the commit for each tag we find, we store the commit-id instead, and only lookup the commit when we really need it. This speeds up the retrieval for showing in the select-box enormously.

Also, this greatly speeds up things like tags.count and tags.first, effectively even rendering my previous change nearly unneeded.

Once this is merged, one only needs to update the :ref in the Gemfile to make the changes valid.

netdata-be commented 12 years ago

I can confirm this patch makes my slow gitlab project (First 30-40 seconds to fast 1-2 seconds)

dzaporozhets commented 12 years ago

tests passes?

nathanvda commented 12 years ago

Yes, the test pass.

dzaporozhets commented 12 years ago

Wating for PR fixing build http://travis-ci.org/#!/gitlabhq/grit/builds/1613828

nathanvda commented 12 years ago

Ok. Weird. Will fix it.