exercise: partition a list by equivalence - merge_JM.py (0/1)

John Machin sjmachin at lexicon.net
Sun Feb 20 02:44:32 EST 2005


On 19 Feb 2005 17:56:27 -0800, bearophileHUGS at lycos.com wrote:

>John Machin>FWIW, here's a brief UAT report:
>
>Here is something else for you.
>Note: for more correct comparisons, for the following tests I've
>disabled the use of Psyco in Graph (usually enabled, if present).
>This looks faster than merge2 for this (quite sparse) random pairs
>test:

[snip]

>
>Timings using clock() (much more reliable than the profilers!), for
>xMax, nPairs = 2000, 10000:
>merge2: 1.222
>merge6: 0.201
>
>Probably merge6 can be improved, reducing memory used...

Perhaps I'm missing a posting of yours -- what are merge2 and merge4?
What is "this random pairs test"? What is xMax (nPairs isn't hard to
guess), and how are you generating your input data?

FWIW, my offering is attached.




More information about the Python-list mailing list