Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Rosetta Code: Long List is Long

by eyepopslikeamosquito (Archbishop)
on Nov 30, 2022 at 22:27 UTC ( [id://11148465]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # llil.pl
    # Example run: perl llil.pl tt1.txt tt2.txt >oo1.tmp
    ...
    
    warn "sort + output  : $taken2 secs\n";
    warn "total          : $taken secs\n";
    
  2. or download this
    sort { $href->{$b} <=> $href->{$a} || $a cmp $b } keys %{$href}
    
  3. or download this
    // llil.cpp. C++ 11 version of Perl llil.pl.
    // g++ compile on Linux:
    ...
    
       return 0;
    }
    
  4. or download this
    # gen-llil.pl
    # Crude program to generate a big LLiL test file to use in benchmarks
    ...
    print "generating test file '$outfile' with count '$count'\n";
    create_test_file($outfile, $count, $wordlen);
    print "file size=", -s $outfile, "\n";
    
  5. or download this
    perl gen-llil.pl big1.txt 200 3
    perl gen-llil.pl big2.txt 200 3
    perl gen-llil.pl big3.txt 200 3
    
  6. or download this
    perl llil.pl big1.txt big2.txt big3.txt >perl.tmp
    
  7. or download this
    llil big1.txt big2.txt big3.txt >cpp.tmp
    
  8. or download this
    diff perl.tmp cpp.tmp
    
  9. or download this
    > perl llil.pl big1.txt big2.txt big3.txt >perl.tmp
    llil start
    get_properties : 11 secs
    sort + output  : 74 secs
    total          : 85 secs
    
  10. or download this
    > llil big1.txt big2.txt big3.txt >cpp.tmp
    llil start (sort version)
    get_properties : 9 secs
    sort + output  : 7 secs
    total          : 16 secs
    
  11. or download this
    > diff cpp.tmp perl.tmp
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://11148465]
Approved by choroba
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-24 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found