KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21585/root/usr/lib64/python2.4/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21585/root/usr/lib64/python2.4/test/sortperf.pyc
mò
‚=5Dc@s‘dZdkZdkZdkZdkZdkZdkZeiƒZd„Z	d„Z
d„Zd„Zd„Z
edjoe
ƒndS(s_Sort performance test.

See main() for command line syntax.
See tabulate() for output format.

Nc	Cs–tiitd|ƒ}yt|dƒ}Wnßtj
oÓt	i	}g}t|ƒD]}||ƒqW~}ypz3t|dƒ}ti||ƒ|iƒd}Wd|o.yti|ƒWqÞtij
oqÞXnXWqxtj
o}dG|GdG|GHqxXnlXti|ƒ}|iƒxNtdƒD]@}t	i|ƒ}|| }||4|iƒ|i|ƒ~q4Wt|ƒ|jpt‚|S(s+Return a list of n random floats in [0, 1).srr%06dtrbtwbNscan't writet:i
(tostpathtjointtdtntfntopentfptIOErrortrandomtrt_[1]txrangetitresulttmarshaltdumptclosetNonetunlinkterrortmsgtloadtranget	randrangettemptreversetextendtlentAssertionError(	RR
RRRR
RRR((t%/usr/lib64/python2.4/test/sortperf.pyt
randfloatssB	*






cCstiiƒdS(N(tsyststdouttflush(((R!R%8scCs9tiƒ}|iƒtiƒ}d||GtƒdS(Ns%6.2f(ttimetclocktt0tLtsorttt1R%(R)R+R(((R!tdoit;s

cCsPtg}dD]}||dq~ƒ}ddt|ƒ}|d|GHxý|D]õ}	d|	>}
t	|
ƒ}d|	|
fGtƒt|ƒ|i
ƒt|ƒt|ƒxOtd	ƒD]A}ti|
ƒ}ti|
ƒ}||||||<||<q¹Wt|ƒ|
d
jo5g}td
ƒD]}|tiƒq&~|d)nt|ƒx1t|
dƒD]}tiƒ|ti|
ƒ<qeWt|ƒ|
d
jo+|d
3||
d
}td„|ƒ}nt|ƒ~ttdg|
ƒ}t|ƒ~|
d}t|dddƒ}|it|ƒƒtt|ƒ}t|ƒHqSWdS(s:Tabulate sort speed for lists of various sizes.

    The sizes are 2**i for i in r (the argument, a list).

    The output displays i, 2**i, and the time to sort arrays of 2**i
    floating point numbers with the following properties:

    *sort: random data
    \sort: descending data
    /sort: ascending data
    3sort: ascending, then 3 random exchanges
    +sort: ascending, then 10 random at the end
    %sort: ascending, then randomly replace 1% of the elements w/ random values
    ~sort: many duplicates
    =sort: all equal
    !sort: worst case scenario

    s	*\/3+%~=!R*s%2s %7ss %6sRs2**iis%2d %7dii
iöÿÿÿidicCs|S(N(tx(R-((R!t<lambda>ysf0.5iiÿÿÿÿN(Rs2**i(ttupleRtchtcasesRtfmtR
RRR"R)R%R,RRtdummyRRti1ti2RtmaptabsthalfRtfloat(R
R0R2R4R5R)R8R1R3RRR((R!ttabulateBsT+






!

5






cCsÌd}d}tido‘ttidƒ}}tidohttidƒ}tidoCd}x)tidD]}d|t|ƒ}qtWti	|ƒq§q«nt
||dƒ}t|ƒdS(sÂMain program when invoked as a script.

    One argument: tabulate a single row.
    Two arguments: tabulate a range (inclusive).
    Extra arguments are used to seed the random generator.

    iiiiiiÍ
N(
tk1tk2R#targvtintR-tathashRtseedRR
R:(R?R<R;R
R-((R!tmainŽst__main__(t__doc__R#R&RRttempfileRt
gettempdirRR"R%R,R:RBt__name__(R,R"RERR%R#R&RRBRRR:((R!t?s							'			L	


Anon7 - 2021