On 11 October 2016 at 15:32, Elliot Gorokhovsky <elliot.gorokhovsky at 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4