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 vstinner
Recipients benjamin.peterson, pitrou, python-dev, serhiy.storchaka, skrah, vstinner
Date 2012-04-05.21:00:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333659631.69.0.600369800185.issue14249@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, benchmarks have spoken, amen. I applied Serhiy Storchaka's patch (version 3). I just replaced expressions in calls to Py_MAX by variables: Py_MAX is a macro and it may have to compute each expression twice. I didn't check if it's more or less efficient. Thanks Serhiy for your contribution! I added your name to Misc/ACKS.

We may change Py_MIN/Py_MAX to something more efficient using typeof():

     #define max(a,b) \
       ({ typeof (a) _a = (a); \
           typeof (b) _b = (b); \
         _a > _b ? _a : _b; })

I don't know which C compilers support it, but gcc does, at least.
History
Date User Action Args
2012-04-05 21:00:31vstinnersetrecipients: + vstinner, pitrou, benjamin.peterson, skrah, python-dev, serhiy.storchaka
2012-04-05 21:00:31vstinnersetmessageid: <1333659631.69.0.600369800185.issue14249@psf.upfronthosting.co.za>
2012-04-05 21:00:31vstinnerlinkissue14249 messages
2012-04-05 21:00:31vstinnercreate