Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Rosetta Code: Long List is Long - GNU Parallel

by marioroy (Prior)
on Feb 09, 2023 at 09:05 UTC ( [id://11150254]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    LC_ALL=C sort -k1 big{1,2,3}.txt | awk -f tally-count.awk | LC_ALL=C s
    +ort -k2nr >out.txt
    
    ...
    LC_ALL=C parsort -k1 big{1,2,3}.txt | ./tally-count | LC_ALL=C parsort
    + -k2nr >out.txt
    
    real time:  3.615 seconds
    
  2. or download this
    LC_ALL=C parsort -k1 big{1,2,3}.txt | awk -f tally-count.awk | LC_ALL=
    +C parsort -k2nr >out.txt
    
    ...
    LC_ALL=C parsort -k1 big{1,2,3}.txt | ./tally-count | LC_ALL=C parsort
    + -k2nr >out.txt
    
    real time:  2.398 seconds
    
  3. or download this
    cat big{1,2,3}.txt | ./linux-q -tT "select c1, sum(c2) from - group by
    + c1 order by sum(c2) desc, c1" >out.txt
    
    ...
    ./linux-q -tT "select c1, sum(c2) from big[1-3].txt group by c1 order 
    +by sum(c2) desc, c1" >out.txt
    
    real time: 89.539 seconds
    
  4. or download this
    # Tally adjacent count fields of duplicate key names.
    
    ...
    END {
       print key, sum
    }
    
  5. or download this
    // -------------------------------------------------------------------
    +---------
    // tally-count.cpp
    ...
    
       return 0;
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found