Author lemburg
Recipients casevh, josh.r, lemburg, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, vstinner, yselivanov, zbyrne
Date 2016-02-04.07:58:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <56B30486.9020207@egenix.com>
In-reply-to <1454565769.63.0.45194845637.issue21955@psf.upfronthosting.co.za>
Content
On 04.02.2016 07:02, Yury Selivanov wrote:
> Attaching a second version of the patch.  (BTW, Serhiy, I tried your idea of using a switch statement to optimize branches (https://github.com/1st1/cpython/blob/fastint2/Python/ceval.c#L5390) -- no detectable speed improvement).

It would be better to consistently have the fast_*() helpers
return -1 in case of an error, instead of -1 or 1.

Overall, I see two problems with doing too many of these
fast paths:

 * the ceval loop may no longer fit in to the CPU cache on
   systems with small cache sizes, since the compiler will likely
   inline all the fast_*() functions (I guess it would be possible
   to simply eliminate all fast paths using a compile time
   flag)

 * maintenance will get more difficult

In a numerics heavy application it's like that all fast paths
will trigger somewhere, but those will likely be better off
using numpy or numba. For a text heavy application such as a web
server, only few fast paths will trigger and so the various
checks only add overhead.

Since 'a'+'b' is a very often used instruction type in the
latter type of applications, please make sure that this fast
path gets more priority in your patch.

Please also check the effects of the fast paths for cases
where they don't trigger, e.g. 'a'+'b' or 'a'*2.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com
History
Date User Action Args
2016-02-04 07:58:06lemburgsetrecipients: + lemburg, rhettinger, mark.dickinson, pitrou, vstinner, casevh, serhiy.storchaka, yselivanov, josh.r, zbyrne
2016-02-04 07:58:06lemburglinkissue21955 messages
2016-02-04 07:58:05lemburgcreate