Commit 3912e386 authored by Steve McIntyre's avatar Steve McIntyre

Add support for a simple on-disk cache of git revs

We can't rely on having a full cache in memory, so add support for
dumping the cache to disk, and retrieving results later. After calling
cache_repo(), call save_cache_to_database() to dump the cache. This
will dump a list of the git revs and commit dates for each file in the
repo to disk (one per file), so we can easily look things up later
without having to call git again.

Initially attempted to do this with a sqlite database, but it didn't
improve performance when doing a large parallel make - if anything, it
was slower than calling git all the time.

Rough timing comparisons on my 4-core laptop with an SSD, all doing:

$ make clean
$ time make -j8

in webwml/german/devel/debian-installer/News...

 * without any cache:            85s
 * with sqlite cache:           120s
 * with this simple list cache:  13s

The cache *does* take quite a bit of space, currently around
300MB. But it's such a big win that I think it's worth it...
parent fc69476a
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment