Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Script exponentially slower as number of files to process increases

by marioroy (Prior)
on Jan 27, 2023 at 03:31 UTC ( [id://11149917]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    9,10c9,10
    < use threads;
    ...
    < my @workers = map threads->create(\&process_file), 1 .. $threads;
    ---
    > my @workers = map MCE::Child->create(\&process_file), 1 .. $threads;
    
  2. or download this
    # threads, Thread::Queue
    
    ...
    real  0m9.035s
    user  0m56.504s
    sys   0m1.097s
    
  3. or download this
    Parsing 35841 files
    maxforks: 8
    ...
    real  0m8.953s
    user  0m52.559s
    sys   0m1.006s
    
  4. or download this
    # threads (same applies to running MCE::Child or parallel module of yo
    +ur choice)
    
    ...
    }
    $queue->end;
    $_->join for @workers;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-18 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found