Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have access to, but no admin rights on, one of our Ubuntu production server, so I had to install the single file version of ack.

I did a trial run (ack vs grep). The results are not impressive and grep does win. However it seems it should be the other way around. Why is grep search faster than ack?

$ time ack Trial .
real    0m20.789s
user    0m4.800s
sys     0m1.020s

$ time grep -nr Trial .
real    0m4.722s
user    0m0.230s
sys     0m0.510s

migration rejected from Jun 7 '13 at 23:42

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as not constructive by Journeyman Geek, Breakthrough, Ƭᴇcʜιᴇ007, soandos, Scott Jun 7 '13 at 23:42

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

ack is interpreted by Perl, while grep implementations are often written in C and compiled to well-optimized native machine code. – Rhymoid Jun 6 '13 at 18:25
Probably because grep has 30+ years of optimization behind it and ack, well, doesn't. – Kevin Jun 6 '13 at 18:25
Why do you think that ack "should be" faster than grep? – Andy Lester Jun 7 '13 at 19:13

Browse other questions tagged or ask your own question.