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 pitrou
Recipients kristjan.jonsson, mark.dickinson, pitrou, scoder
Date 2011-02-02.18:54:15
SpamBayes Score 1.7526109e-07
Marked as misclassified No
Message-id <1296672852.3718.16.camel@localhost.localdomain>
In-reply-to <1296672515.45.0.746065091536.issue10227@psf.upfronthosting.co.za>
Content
> I ran the list tests in pybench and got this:
> 
> Test               minimum run-time        average  run-time
>                     this    other   diff    this    other   diff
> --------------------------------------------------------------------
>     ListSlicing:    66ms    67ms   -2.2%    67ms    68ms   -2.7%
>      SmallLists:    61ms    64ms   -4.5%    61ms    65ms   -5.6%
> --------------------------------------------------------------------
> Totals:           127ms   131ms   -3.3%   128ms   133ms   -4.1%
> 
> Repeating this gave me anything between 1.5% and 3.5% in total, with
> >2% for the small lists benchmark (which is the expected best case as
> slicing large lists obviously dominates the slice object creation).
> 
> IMHO, even 2% would be pretty good for such a small change.

Well, 3% on such micro-benchmarks (and, I assume, 0% on the rest) is
generally considered very small.
On the other hand, I agree the patch itself is quite simple.

> by
> 
>          _Py_NewReference((PyObject *)obj);
> 
> in the patch. New patch attached.

Don't you also need a _Py_ForgetReference() at the other end? Or have I
missed it?
History
Date User Action Args
2011-02-02 18:54:17pitrousetrecipients: + pitrou, mark.dickinson, scoder, kristjan.jonsson
2011-02-02 18:54:15pitroulinkissue10227 messages
2011-02-02 18:54:15pitroucreate