|
|
grep faster and more effectively than grep, using grep
1) I'm a Unix geek, so I don't have any anti-Unix-hint prejudice, but this is so not a Mac OS X hint that it's kind of scary. 2) If you're going to submit a Unix geek hint, at least make it a legit one. Anyone who is using grep in any of the hints on this site is almost definitely using it in an interactive setting, and any Unix geek worth their salt would know that you shouldn't optimize until performance actually becomes an issue, and in an interactive invocation of grep, the overhead of spawing the new process more than outweighs the overhead of the regex match so the "optimization" doesn't buy you anything of value. 3) If performance really does matter, again, spawning the grep process is going to be the big hit; you can avoid that and usually get much better performance by using shell constructs to do the fixed-string match:
grep faster and more effectively than grep, using grep
Mac OS X has *nix underpinnings, so Unix hints are incredibly valuable for some tasks. I'm using the hints on this site as a Mac (power) user who wants to harness what these tools can provide. Yes, we could obtain and read the entire BASH Reference Manual or scour through the scarcely-readable "sh(1)" man page, but *nix is not something we use for hours on end and have hardwired into our fingertips.
grep faster and more effectively than grep, using grep
You need to learn to read better (which might explain why manpages are so baffling to you). I never said that the hint wasn't fast enough; I said that it was pointless, because the speed of an interactive invocation of grep is very rarely going to be functionally helped by the switch to fgrep, and if speed really were an issue, using fgrep would rarely be the best solution. I've seen literally hundreds of people over the years get caught up in trying to optimize things that don't need to be optimized, and in ways that don't really help them; all I was trying to do was prevent people from wasting their time on what is almost always a fruitless endeavor.
grep faster and more effectively than grep, using grep
dzurn is spot on. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|