Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: You don't always have to use regexes

by PetaMem (Priest)
on Feb 24, 2005 at 21:57 UTC ( [id://434277]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl_parallel -w
    # For Emacs: -*- mode:cperl; mode:folding -*-
    ...
                'regex' => sub { $value =~ /true/i },
        }
    );
    
  2. or download this
    Benchmark: timing 5000000 iterations of index, regex...
         index:  2 wallclock secs ( 1.04 usr +  0.00 sys =  1.04 CPU) @ 48
    +07692.31/s (n=5000000)
    ...
    Benchmark: timing 5000000 iterations of index, regex...
         index:  3 wallclock secs ( 2.83 usr +  0.00 sys =  2.83 CPU) @ 17
    +66784.45/s (n=5000000)
         regex:  4 wallclock secs ( 3.45 usr +  0.02 sys =  3.47 CPU) @ 14
    +40922.19/s (n=5000000)
    
  3. or download this
    Benchmark: timing 5000000 iterations of index, regex...
         index:  1 wallclock secs ( 1.10 usr +  0.00 sys =  1.10 CPU) @ 45
    +45454.55/s (n=5000000)
    ...
    Benchmark: timing 5000000 iterations of index, regex...
         index:  4 wallclock secs ( 2.99 usr +  0.01 sys =  3.00 CPU) @ 16
    +66666.67/s (n=5000000)
         regex:  3 wallclock secs ( 3.66 usr +  0.01 sys =  3.67 CPU) @ 13
    +62397.82/s (n=5000000)
    
  4. or download this
    perl_parallel -V
    Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
    ...
        osname=linux, osvers=2.6.8-24-smp, archname=i586-linux-thread-mult
    +i
        uname='linux builder 2.6.8-24-smp #1 smp wed oct 6 09:16:23 utc 20
    +04 i686 i686 i386 gnulinux '
        config_args='-ds -e -Dprefix=/opt/PM_perl-5.8.6 -Dvendorprefix=/op
    +t/PM_perl-5.8.6 -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_n
    +dbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -g -march=i586 -mcpu=i6
    +86 -fmessage-length=0 -Wall -pipe'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://434277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found