title: From node.js, which is faster, shell grep or fs.readFile?
body: <p>I have a long running node.js process and I need to scan a log file for a pattern. I have at least two obvious choices: <a href="http://nodejs.org/api/child_process.html">spawn a grep process</a> or read the file using <a href="http://nodejs.org/api/fs.html">fs.read*</a> and parse the buffer/stream in node.js. I haven't found a comparison of the two methods on the intarwebs. My question is twofold:</p>
  
  <ol>
  <li>which is faster?</li>
  <li>why might I prefer one technique over the other?</li>
  </ol>