On 11 October 2016 at 15:32, Elliot Gorokhovsky
<elliot.gorokhov...@gmail.com> wrote:
> But the sort mutates F...does the setup get executed each time? I thought
> it's just at the beginning. So then F gets mutated (sorted) and subsequent
> sorts time wrong.

Did I not say earlier - sorry. I'm suggesting that you put each timing
run into a separate Python process.

# Optimised code
python -m perf timeit -s "from mymod import FastList; L=<whatever you
do to create the list>;F=FastList(L)" "F.fastsort()"
# Core sort routine
python -m perf timeit -s "L=<whatever you do to create the list>" "L.sort()"
# Or maybe, if FastList exposes the existing sort function as well
# Non-optimised code
python -m perf timeit -s "from mymod import FastList; L=<whatever you
do to create the list>;F=FastList(L)" "F.sort()"

Paul.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to