{"thread":{"id":"4863","subject":"Note on \"git grep\"","startedAt":"2006-07-12T21:33:22Z","lastAt":"2006-07-12T21:33:22Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"23725","messageId":"Pine.LNX.4.64.0607121428300.5623@g5.osdl.org","threadId":"4863","inReplyTo":null,"subject":"Note on \"git grep\"","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-12T21:33:22Z","receivedAt":"2006-07-12T21:33:22Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nHeh. Since I've been bisecting a laptop of mine that keeps having ACPI \nproblems, I notived something fun about \"git grep\".\n\nUsing the external \"grep\" is about 10 times faster for the hot-cache case, \nbut for cold-cache, forcing the internal one is actually a _lot_ faster \nbecause a fully packed kernel archive just gets wonderfully better IO \npatterns than the \"real filesystem\" image.\n\nSo doing \"git grep some-random-string HEAD\" takes about 16 seconds \ncold-cache, and 11 seconds hot-cache.\n\nIn contrast, doing \"git grep some-random-string\" takes over a minute \ncold-cache, and about 2 seconds hot-cache. It's kind of sad that we can't \ndynamically notice which case we have, since the hot-cache case is _so_ \nmuch better for the external grep, but then cold-cache sucks for it..\n\nI just thought I'd point this out to people, since I found it interesting \nhow the built-in grep functionality actually outperforms the \"real\" one \nunder some circumstances.\n\n\t\tLinus\n"}]}