On Mon, Apr 21, 2003 at 05:23:25PM -0400, Raymond Hettinger wrote: > [RH] > > For the C implementation, consider bypassing operator.add > > and calling the nb_add slot directly. It's faster and fulfills > > the intention to avoid the alternative call to sq_concat. > > Forget I said that, you still need PyNumber_Add() to > handle coercion and such. Though without some > special casing it's going to be darned difficult to match > the performance of a pure python for-loop (especially > for a sequence of integers). Why not move the integer add optimization from ceval.c into PyNumber_Add ? Granted you have an extra call on the fast path, but on the other hand * more code could benefit from this optimization * you don't have code related to the same operation spread in several files * the ceval loop has a reduced footprint -- Ludovic Aubry LOGILAB, Paris (France). http://www.logilab.com http://www.logilab.fr http://www.logilab.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4