On 02/05/2010 02:43 PM, Titus von der Malsburg wrote:
Hi list!

When I do a simple grep on a 50Mb file with ~1.3 million lines, it
takes 2s on Linux (Ubuntu karmic with stock kernel, 2.6.31-17) and
~12min on OSX (v. 10.5.8):

   grep '^[0-9]'<  file.dat>  /dev/null

~1.2 million lines actually begin with a number.  Both systems run on
a Core 2 Duo CPU at 2.2 GHz and have 2GB of RAM. On both systems, I
use utf-8 encoding (en_US.UTF-8).

I wrote a simple C program that matches lines that begin with a number
to see if the problem lies with IO.  This programm takes ~1.5s on
Linux and ~1s on OSX.

Does anybody have an idea what the cause of the problem on OSX might
be?  And how can it be fixed?

Can you try running "grep --version" on Mac OS X?

Paolo


Reply via email to