rcrowley/freight — pull request #31 by haus (2013-02-15 06:29:08+00:00)
Title: Add source and binary control caching

These commits add basic source and binary control caching to avoid the potentially expensive hashing operations against binary files that occur on each freight-cache run. They also add a freight.conf setting to toggle this new behavior, defaulting to false to preserve current behavior and a new binary to clear the cache of these files.

On test runs with a repo of 313 debs and about 50 source packages, the caching improved freight-cache run times from 20 seconds to 8 or 9 seconds.

Current master:
# time freight-cache

real	0m19.794s
user	0m3.712s
sys	0m1.272s

With control file (from .deb extraction) caching:

First cold run:

real	0m20.015s
user	0m3.816s
sys	0m1.396s

First hot run:

real	0m12.793s
user	0m1.812s
sys	0m0.800s

With source caching (from .dsc file) [aggregate with control file caching]:

First cold run:

real	0m20.181s
user	0m3.824s
sys	0m1.376s

First hot run:

real	0m8.788s
user	0m0.108s
sys	0m0.448s