[New-bugs-announce] [issue2792] alternate fast builtin sum, rev'd

Jean Brouwers report at bugs.python.org
Thu May 8 21:53:20 CEST 2008

New submission from Jean Brouwers <MrJean1 at Gmail.com>:

Here is one more, final attempt to improve fast summation, somewhat.

This version inspects the type of both the sum and the first item and 
adds all ints and floats without any PyNumber_Add() call and in order.

Also, the results for this test case are compatible:

>>> d = [1000000000000000, -1000000000000000.0, .0000000000000001, 
>>> sum(d)
>>> d[0] + sum(d[1:])

/Jean Brouwers

components: Interpreter Core
files: bltinmodule3.c.diff
keywords: patch
messages: 66434
nosy: MrJean1
severity: normal
status: open
title: alternate fast builtin sum, rev'd
type: performance
versions: Python 2.6
Added file: http://bugs.python.org/file10223/bltinmodule3.c.diff

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list