This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author stutzbach
Recipients collinwinter, pitrou, rhettinger, stutzbach, tim.peters
Date 2010-09-21.21:40:35
SpamBayes Score 7.1054274e-15
Marked as misclassified No
Message-id <1285105236.97.0.0965020674125.issue9915@psf.upfronthosting.co.za>
In-reply-to
Content
Antoine said:
> I don't think there's any point in micro-optimizations such as
> stack_keys.

Good point.  I'll try taking that out and see how it impacts the timing.

Raymond said:
> The memmove, memcpy functions are tricky to time because of varying
> performance across various architectures and libraries.  Code like
> "*dest++ = *pb++;" is hard to beat, especially for short runs.

Anything that was a memmove or memcpy remains a memmove or memcpy.  Anything that was equivalent but implemented "by hand" remains that way. (Although in either case the details have been moved into a sortslice_* static inline function.) 

I have avoided changing any memcpy/memmove to "by hand" (or vise versa), because I know that it might be faster on my system but slower on someone else's.

> Is the code slower for the common case where a key function is not
> provided?  

The short answer is "no".  The long answer is that I conducted enough experiments for the 95% confidence interval of the ratio of execution times (patched/trunk) to be 0.994735131656 +/- 0.00540792612332, for the case where no key function is provided.

> The patch seems to add a level of indirection throughout the code
> (lots of "lo.values" instead of just "lo").

The compiler can exactly compute the stack offset of "lo.values", so it should require the same number and type of instructions to access as just "lo".

> A more extensive timing suite would be helpful; the ones listed in 
> the first post are simplistic.

I have one, but it's clunky and requires modifying the script to change important parameters.  I'm refactoring it to use argparse and will attach it to this issue when it's ready.
History
Date User Action Args
2010-09-21 21:40:37stutzbachsetrecipients: + stutzbach, tim.peters, collinwinter, rhettinger, pitrou
2010-09-21 21:40:36stutzbachsetmessageid: <1285105236.97.0.0965020674125.issue9915@psf.upfronthosting.co.za>
2010-09-21 21:40:35stutzbachlinkissue9915 messages
2010-09-21 21:40:35stutzbachcreate