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 rhettinger
Recipients amaury.forgeotdarc, collinwinter, eric.smith, pitrou, rhettinger, stutzbach, terry.reedy, tim.peters
Date 2010-11-23.02:12:09
SpamBayes Score 5.3494625e-10
Marked as misclassified No
Message-id <1290478333.95.0.29705999518.issue9915@psf.upfronthosting.co.za>
In-reply-to
Content
> If the "key" parameter was not used, then the values pointer 
> is a null pointer. 
  . . .
> Since the branch will always be the same throughout any given 
> call to sort(), CPU branch prediction is effective making the
> branches fairly inexpensive.

I see how the branch can be optimized away but not how it gets cheaper than when there was no branch at all (and no lo.keys and lo.values extra layer of direction).  How did it get *faster* than the original (in the case with no key-function)?

>> Why did the variable names change, pa/pb to ssa/ssb, etc.?
> I took "pa" to mean "pointer to array A", but it's now 
> a sortslice structure instead of a pointer.

That makes sense.

> If I can get Rietveld to show each of my local commits,
> would it be helpful to see the patch in incremental pieces?

At this point, it may be best for me to read the patch as-is.  Unfortunately, it's a big patch and will likely take a lot of time to read in detail.

Is there any chance you can persuade Uncle Timmy to review this?  This is all his code and he's likely to have some good insights.

Also, is there anyone else who is knowledgeable about Python on less common platforms?  ISTM part of the optimization is dependent on the branch-prediction and other nuances that vary from environment to environment.  That being said, doing fewer memory allocations is always a win.
History
Date User Action Args
2010-11-23 02:12:14rhettingersetrecipients: + rhettinger, tim.peters, collinwinter, terry.reedy, amaury.forgeotdarc, pitrou, eric.smith, stutzbach
2010-11-23 02:12:13rhettingersetmessageid: <1290478333.95.0.29705999518.issue9915@psf.upfronthosting.co.za>
2010-11-23 02:12:10rhettingerlinkissue9915 messages
2010-11-23 02:12:10rhettingercreate