This Time Self-Hosted
dark mode light mode Search

Gitarella can use memcache

Okay today I wanted to write something for gitarella too, although I’ll have to stop now and go full-immersion into my job to make sure I don’t get behind my schedule because of KDE.

The first thing I looked at was implementing the sort of projects, it’s not difficult, it required me just to get the parameter from the CGI and then use the right entry in the hash to sort the array, it’s not bad at all, three lines of ruby code and gitarella supported sorting on the project page.

After that I decided to start taking a look to a new feature that gitweb don’t have as far as I know. As I also access all the information via the git-* commands it’s quite slow to access it multiple times. I already cached for a single session the tip of all the repos, but I still required to read all the data every time. Luckily as git assigns a unique sha1 for every object, using a cache on this is optimal.

What I decided to do is to use memcache for the job, so I had to find some Ruby bindings (that I finally found – the site is under maintenance tho), and then started looking into implementing it. It was really trivial to do, a few lines of code and now gitarella can use memcache if configured (but it works also without it, it’s not an hard dependency).

Right now I had to add three dev-ruby packages to my overlay for gitarella: ruby-liquid, Ruby-MemCache and IO-Reactor (dependency of Ruby-MemCache), but the work seems to proceed well. Next thing to do: display the log 😉

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.