> In short, could you do another Python, Pyston* run with sort function replaced with ...

First, I made the following modification to resolve "TypeError: 'type' object is not subscriptable" using Pyston 2.3.5.

$ diff llil1.py llil2.py 53c53 < def collect( data_list :list ) ->dict[ str, int ]: --- > def collect( data_list :list ) ->dict: 87c87 < def process( cat_count :dict[ str, int ] ) ->Generator[ str, None, N +one ]: --- > def process( cat_count :dict ) ->Generator: 110c110 < def sort_native( cat_count :dict[ str, int ] ) ->list[ str ]: --- > def sort_native( cat_count :dict ) ->list:

Python 3.10.7:

# I have pyston_lite_autoload installed already. It can be disabled. $ DISABLE_PYSTON=1 python3 llil2.py big1.txt big2.txt big3.txt > out1. +txt collect time : 5.1 s sort+format time : 3.6 s total processing time: 8.7 s output time : 3.6 s total time : 12.2 s

Python with Pyston-lite loaded automatically:

# Install pyston_lite_autoload to ~/.local/lib/python3.10/site-package +s/. $ python3 -m pip install --user pyston_lite_autoload $ python3 llil2.py big1.txt big2.txt big3.txt > out2.txt collect time : 4.3 s sort+format time : 3.5 s total processing time: 7.9 s output time : 3.3 s total time : 11.2 s

Pyston 2.3.5:

$ ./pyston_2.3.5/bin/pyston3 llil2.py big1.txt big2.txt big3.txt > out +3.txt collect time : 3.7 s sort+format time : 3.4 s total processing time: 7.1 s output time : 3.0 s total time : 10.1 s

Pyston makes it all the more fun.


In reply to Re^4: Rosetta Code: Long List is Long -- Python by marioroy
in thread Rosetta Code: Long List is Long by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.