News for hackers. Stuff that matters.
Re:Some bad Git situations and how I got myself out of them by Jtsummers on Friday September 09, 2016 @02:29PM (#12464845)
16 seconds versus a fraction of a second. There's a big difference, somewhere, in what these two systems are doing to accomplish (ostensibly) the same task. And if it's not accomplishing the same task, they shouldn't be using the same verb (grep) for it.

And I disagree with this point:

  Things like search time are *not* a productivity bottleneck.
I maintain old codebases. I don't know them by heart, I didn't write them and the documentation is often poor (for the codebase, the specs are usually decent, but that's the system spec, not the code spec). Search is critical for me to get around these things. A 16s search would be incredibly annoying and bottlenecking compared to one that's nearly instant.

Not having looked at the internals of either, I wonder if this is related to other performance differences in grep implementations across *nix systems.

EDIT: Exploring this, it seems they don't do the same thing? `git grep` searches, by default, only the most recent working tree or revision. It doesn't search every revision unless you tell it to. `hg grep` (don't have it installed) seems to search every revision by default, so restricting it to the current revision requires an explicit command line option specifying the revision range to search.

There are no comments on this comment yet.