En op 18 september 2002 sprak `/anick:
> Hmm... Make me want to rush back at my Java books, this
> sure doesn't...
Perl has been beaten on this problem by both egrep and gawk.
The egrep and gawk versions below are both a little faster
(on Linux) and a little shorter too. egrep was the faste
On Wed, Sep 18, 2002 at 11:14:33AM +1000, [EMAIL PROTECTED] wrote:
> En op 18 september 2002 sprak `/anick:
> > /^192\.(?:9|18|29)\./||/\.(?:gif|GIF|jpg|JPG|css|CSS) HTTP/ or print
> >
> > is still a wee bit faster.
>
> BTW, on my (perhaps unrepresentative) 17 MB test file on Windows,
> `/ani
En op 18 september 2002 sprak `/anick:
> /^192\.(?:9|18|29)\./||/\.(?:gif|GIF|jpg|JPG|css|CSS) HTTP/ or print
>
> is still a wee bit faster.
You can save a stroke by replacing:
9|18|29
with:
2?9|18
but it seems a flea's proboscis slower in my primitive speed test.
BTW, on my (perhaps unr
On Tue, Sep 17, 2002 at 12:22:48PM -0500, Chris Dolan wrote:
> Yanick wrote:
> > On Wed, Sep 18, 2002 at 12:09:18AM +1000, [EMAIL PROTECTED] wrote:
>
> /^192\.(?:9|18|29)\./||/\.(gif|jpg|css|GIF|JPG|CSS) HTTP/ or print
>
> Also, "?:" is not really needed. We don't care about backreferences.
Yanick wrote:
> On Wed, Sep 18, 2002 at 12:09:18AM +1000, [EMAIL PROTECTED] wrote:
>
>>I have not seriously tried the 100 meter dash, but this
>>one should be a little faster:
>>
>>#!perl -n
>>/^192\.(?:9|18|29)\./||/(?i:gif|jpg|css) HTTP/ or print
>
>
> /^192\.(?:9|18|29)\./||/(gif|jpg|css|G
On Wed, Sep 18, 2002 at 12:09:18AM +1000, [EMAIL PROTECTED] wrote:
> I have not seriously tried the 100 meter dash, but this
> one should be a little faster:
>
> #!perl -n
> /^192\.(?:9|18|29)\./||/(?i:gif|jpg|css) HTTP/ or print
/^192\.(?:9|18|29)\./||/(gif|jpg|css|GIF|JPG|CSS) HTTP/ or print
I noticed a Java vs. Perl story on http://use.perl.org today.
http://developer.java.sun.com/developer/qow/archive/184/index.jsp
claimed that a 100-line Java program was twice as fast as the
Perl equivalent, but did not publish said Perl equivalent.
Anyway, davorg got it from the author and here it