develooper Front page | perl.perl5.porters | Postings from January 2011

Re: ack is dead, long live ack (was: [perl.git] branch blead,updated. v5.13.8-167-gc1b879e)

Thread Previous | Thread Next
From:
Aaron Crane
Date:
January 10, 2011 09:57
Subject:
Re: ack is dead, long live ack (was: [perl.git] branch blead,updated. v5.13.8-167-gc1b879e)
Message ID:
AANLkTinCVPq_Ageqp67muvWPQXpYOG5cRtzhtQEy3w0S@mail.gmail.com
Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
> * Aaron Crane <perl@aaroncrane.co.uk> [2011-01-09 13:10]:
>> AFAICT, the most important reason for the speed of `git grep`
>> is that (in recent versions, at least) it uses multiple
>> threads.
>
> I assumed, on no factual basis, that one of the reasons is that
> it uses the object store whenever possible instead of the working
> copy, which would speed up `git grep` in much the same way it
> makes `git checkout` faster than `cp -R`. (Compression and linear
> pack files reduce I/O.) I don’t know if that’s actually the case,
> though.

Oh, yes, I'm sure that helps as well.  But my hunch is that the win
from doing that, while worth having, is less valuable overall than
being able to split execution over multiple cores.

>>  ggv() { git grep -O${DISPLAY:+g}vim -E "$@"; }
>
> Nice! Even nicer, with `-Ovi` it will put the cursor on the first
> match immediately. Very slick. Unfortunately, `-Ovim` does not do
> the same (nor, unsurprisingly then, does `-Ogvim`). Hrm. I wonder
> if it’s intentional to avoid listing every vi clone in the code,
> or something they’ll accept patches for…

I think the current implementation (which adds a `+/pattern` argument
for `-Oless` and `-Ovi` and nothing else) was deliberately chosen as a
simple starting point, with the intention that something better could
be added later.  But there's only one way to find out for sure…

-- 
Aaron Crane ** http://aaroncrane.co.uk/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About