Showing content from http://mail.python.org/pipermail/python-dev/attachments/20161010/23bac208/attachment.html below:
<div dir="ltr"><div>Hm... that is strange, but I don't think there's anything wrong with the way I'm timing, though I agree perf/timeit would be better. I ran the benchmark a couple of times and the numbers seem to exactly line up something like one in five times; perhaps not that crazy considering they're executing nearly the same code?<br><br></div>Anyway, benchmarking technique aside, the point is that it it works well for small lists (i.e. doesn't affect performance). <br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 10, 2016 at 2:53 PM Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Oct 10, 2016 at 1:42 PM, Elliot Gorokhovsky<br class="gmail_msg">
<<a href="mailto:elliot.gorokhovsky@gmail.com" class="gmail_msg" target="_blank">elliot.gorokhovsky@gmail.com</a>> wrote:<br class="gmail_msg">
> *** 10 strings ***<br class="gmail_msg">
> F.fastsort(): 1.6689300537109375e-06<br class="gmail_msg">
> F.sort(): 1.6689300537109375e-06<br class="gmail_msg">
<br class="gmail_msg">
I think something has gone wrong with your timing harness...<br class="gmail_msg">
<br class="gmail_msg">
For accurately timing microbenchmarks, you should use timeit, or<br class="gmail_msg">
better yet Victor Stinner's perf package:<br class="gmail_msg">
 <a href="https://perf.readthedocs.io/" rel="noreferrer" class="gmail_msg" target="_blank">https://perf.readthedocs.io/</a><br class="gmail_msg">
<br class="gmail_msg">
-n<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Nathaniel J. Smith -- <a href="https://vorpus.org" rel="noreferrer" class="gmail_msg" target="_blank">https://vorpus.org</a><br class="gmail_msg">
</blockquote></div>
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