git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fix silly typo in new builtin grep

From
Linus Torvalds <torvalds@osdl.org>
Date
May 16, 2006, 01:07 UTC
Message-ID
<Pine.LNX.4.64.0605151801100.3866@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0605151743360.3866@g5.osdl.org>
On Mon, 15 May 2006, Linus Torvalds wrote:
Show 9 quoted lines
> 
> Me likee the new built-in grep. The ability to say
> 
> 	git grep __make_request v2.6.13 -- '*.c'
> 
> to grep for it in a specific version is well worth the fact that it 
> obviously ends up being slower than grepping in the currently checked-out 
> tree. It's doing a hell of a lot more, but despite that it's not at all 
> that slow.

Side note: it looks like the version generation really isn't much of a cost. Grepping in v2.6.13 isn't really noticeably slower than the "pre-external grep" was for grepping in the checked-out file tree.

So it looks like we _could_ improve the grepping of specific versions noticeably if we were to have a better regex library that was as optimized as what the external GNU grep seems to do. The actual revision data generation doesn't seem to be the biggest cost, and at least in _theory_ we could probably speed things up by a factor of two with a faster regex library.

That's good to keep in mind. It may be that the glibc regexp is just not very good, but quite frankly, I would personally not be surprised if it's better than most (ie windows, for example).

			Linus
Previous: Linus TorvaldsNext: Morten Welinder
Message 2 of 6 in “Fix silly typo in new builtin grep”
  1. Linus TorvaldsMay 16, 2006
  2. Linus TorvaldsMay 16, 2006
  3. Morten WelinderMay 16, 2006
  4. Linus TorvaldsMay 16, 2006
  5. Junio C HamanoMay 16, 2006
  6. Linus TorvaldsMay 16, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.