Re: [RFC] Native access to Git LFS cache
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 27, 2016, 15:53 UTC
- Message-ID
- <CACsJy8B7ie_oQRZ7Pw3NTo4YyXwZOer-iDUVxDPSY_uhrQi1bw@mail.gmail.com>
- In-Reply-To
- <1467005913-6503-1-git-send-email-larsxschneider@gmail.com>
On Mon, Jun 27, 2016 at 7:38 AM, <larsxschneider@gmail.com> wrote:
Show 8 quoted lines
> ## Proposed solution > Git LFS caches its objects under .git/lfs/objects. Most of the time Git > LFS objects are already available in the cache (e.g. if you switch branches > back and forth). I implemented these "cache hits" natively in Git. > Please note that this implementation is just a quick and dirty proof of > concept. If the Git community agrees that this kind of approach would be > acceptable then I will start to work on a proper patch series with cross > platform support and unit tests.
Would it be possible to move all this code to a separate daemon? Instead of spawning a new process to do the filtering, you send a command "convert this" over maybe unix socket and either receive the whole result over the socket, or receive a path of the result.
I don't think hard coding "git-lfs" is a good way to go (if you keep that in the final impl. of course). I guess the costly part is spawning processes and going through the same process initialization for every object. If we keep a daemon running, all that is gone. You still have to pay for extra context switches and memory copy (unless you send the path, but then it could be racy), but I think that's negligible. And all smudge/clean filters can do caching and more if they want to.
-- Duy