Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Rosetta Code: Long List is Long (faster - vec - openmp)

by eyepopslikeamosquito (Archbishop)
on Jan 10, 2023 at 12:12 UTC ( [id://11149482]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    > ./llil2vec big1.txt big2.txt big3.txt >f.tmp
    llil2vec start
    ...
    total        wall clock time : 5 secs
    
    > diff f.tmp vec.tmp
    
  2. or download this
    > For some reason, short string version is faster when compiled with c
    +lang++
    > (while long string version is not)
    ...
    total        wall clock time : 3 secs
    
    > diff f.tmp vec.tmp
    
  3. or download this
    // llil2vec.cpp.
    // Vector version of llil2grt.pl.
    ...
    
       return 0;
    }
    
  4. or download this
    // llil3vec.cpp.
    // Vector version of llil2grt.pl.
    ...
    
       return 0;
    }
    
  5. or download this
    > g++ -o llil3vec -std=c++20 -Wall -O3 llil3vec.cpp
    > time ./llil3vec big1.txt big2.txt big3.txt  >f.tmp
    ...
    sys     0m0.465s
    
    > diff f.tmp vec.tmp
    
  6. or download this
    // llil3grt.cpp.
    // Inspired by llilgrt.pl: improve sort performance via a negative cou
    +nt.
    ...
    
       return 0;
    }
    
  7. or download this
    // llil3m.cpp. C++ 11 version of Perl llil.pl.
    // C++ version inspired by Mario's famous dualvar two-sort Perl soluti
    +on.
    ...
    
       return 0;
    }
    
  8. or download this
    llil3grt (fixed string length=6) start
       - openmp version
    ...
    real    0m4.752s
    user    0m4.241s
    sys     0m0.511s
    
  9. or download this
    $ time ./llil3m big1.txt big2.txt big3.txt  >f.tmp
    llil3m (fixed string length=6) start
    ...
    real    0m4.713s
    user    0m9.238s
    sys     0m0.679s
    
  10. or download this
    llil3m (fixed string length=6) start
       - openmp version
    ...
    real    0m4.182s
    user    0m6.128s
    sys     0m0.473s
    
  11. or download this
    $ time ./llil3m big1.txt big2.txt big3.txt  >f.tmp
    llil3m (fixed string length=6) start
    ...
    real    0m4.784s
    user    0m4.232s
    sys     0m0.551s
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found