Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Need to speed up many regex substitutions and somehow make them a here-doc list (MCE solution)

by marioroy (Prior)
on Oct 05, 2022 at 22:10 UTC ( [id://11147266]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    % time ./re.sh 
    real    0m5,201s
    user    0m43,394s
    sys    0m1,302
    
  2. or download this
    #!/usr/bin/env perl
    # https://www.perlmonks.org/?node_id=11147200
    ...
        }
    )->spawn;
    
  3. or download this
    # first, truncate output file
    { open my $fh, '>', "out-sed.dat" or die "$!\n"; }
    ...
    $mce->process("in.txt", { user_args => [ "out-sed.dat" ] })
    $mce->shutdown;
    
  4. or download this
    # Process file(s).
    my $status = 0;
    ...
    $mce->shutdown; # reap workers
    exit $status;
    
  5. or download this
    # Worker function.
    sub process_chunk {
    ...
        MCE->relay_unlock;
    }
    
  6. or download this
    # Worker function.
    sub process_chunk {
    ...
        MCE->relay_unlock;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-24 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found