Re: [PATCH v2 0/3] grep multithreading and scaling
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Dec 5, 2011, 20:16 UTC
- Message-ID
- <201112052116.48106.trast@student.ethz.ch>
- In-Reply-To
- <201112051038.16423.trast@student.ethz.ch>
Thomas Rast wrote:
> > I just found out that on Linux, there's mincore() that can tell us > (racily, but who cares) whether a given file mapping is in memory.
[...]
Show 10 quoted lines
> So that looks fairly promising, and the order would then be: > > - if stat-clean, and we have mincore(), and it tells us we can do it > cheaply: grab file from tree > > - if it's a loose object: decompress it > > - if stat-clean: grab file from tree > > - access packs as usual
Just a small note, I tried two things:
* the simpler option of grabbing a loose object if it exists and is mincore() turns out to massively slow down 'git log HEAD', probably because only very few of these objects are loose in the first place
* doing this only under grep's use_threads, and dropping the lock around unpack_sha1_file() [i.e., zlib decompression] still results in a git-grep that is slower than without this, though not much
So no improvement here. Will have to look into the worktree trick though.
--
Thomas Rast
trast@{inf,student}.ethz.ch