bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] gawk 3.1.7 on RHEL6 much slower than 3.1.3 on RHEL 4.7?


From: Aharon Robbins
Subject: Re: [bug-gawk] gawk 3.1.7 on RHEL6 much slower than 3.1.3 on RHEL 4.7?
Date: Sun, 28 Oct 2012 11:35:44 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Hi.  Thanks for this:

> Date: Tue, 16 Oct 2012 08:58:33 +0100
> From: Joseph Watkins <address@hidden>
> To: address@hidden
> Subject: [bug-gawk] gawk 3.1.7 on RHEL6 much slower than 3.1.3 on RHEL 4.7?
>
> Hi all,
>
> I have two identical servers in terms of hardware (actually vm's), one
> at RHEL 4.7 gawk 3.1.3, one at RHEL 6 gawk 3.1.7
>
> On RHEL6 gawk is very much slower. I did a simple test on a  3.7M line
> text file, with a simple gawk command:
>
> On RH4.7, gawk 3.1.3 I get:
>
> time gawk '/^pat1/&&/pat2/ {x++};END {print "x="x}' file
> x=40874
>
> real 0m7.266s user 0m6.809s sys 0m0.460s
>
> On RH6, gawk 3.1.7 I get same x result, with times:
>
> real 1m28.138s user 1m27.657s sys 0m0.453s
>
> 7s vs 1m28s! Initially I thought something had happened to the vm
> after upgrade, but other tests of CPU (e.g. gzips, the same program in
> perl) produce similar results on each. So it seems to be down to gawk.
> Not sure this is the correct place to ask, but are there known
> performance problems with gawk 3.1.7 on RH 6?
>
> Cheers,
> Joe

As Eli Zaretskii answered, it is likely related to locales. If you do

        export LC_ALL=C

and then run your tests, you should see 3.1.7 giving comparable speeds
to 3.1.3, which dates from before locale support was added to gawk.

FYI, 3.1.7 is 3 years old: Redhat should upgrade. The last released
3.1 version was 3.1.8, and there are a few fixes over that in the git
repo.  However, gawk 4.0.1 is the latest official released version which
has many feature improvements and some bug fixes.  You may wish to try
that version. I think that even without LC_ALL=C for basic things it
is just as (or almost just as) fast as 3.1.3.

Hope this helps,

Arnold



reply via email to

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