Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Hash Search is VERY slow

by karlgoethebier (Abbot)
on Sep 29, 2021 at 15:36 UTC ( [id://11137115]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Hash Search is VERY slow
in thread Hash Search is VERY slow

Yes sure. Anyway:

#!/usr/bin/env perl use strict; use warnings; use MCE::Loop; use Data::Dump; use autodie; use feature qw(say); say $0; my $file = q(data.csv); my $cores = MCE::Util::get_ncpu(); MCE::Loop::init( { max_workers => $cores, use_slurpio => 1, }); my @result = mce_loop_f { # say $_[2]; my $slurp_ref = $_[1]; my @rows; open my $fh, '<', $slurp_ref; while (<$fh>) { chomp; my @row = (split /,/, $_); push @rows, \@row ; } close $fh; MCE->gather(@rows); } $file; MCE::Loop->finish; dd \@result; __END__

And yes, i'm aware that i shouldn't split etc.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-18 07:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found