bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep extremely slow on OSX


From: Paolo Bonzini
Subject: Re: grep extremely slow on OSX
Date: Sat, 06 Feb 2010 12:56:34 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1

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

[Prev in Thread] Current Thread [Next in Thread]