[issue2792] alternate fast builtin sum, rev'd
Jean Brouwers
report at bugs.python.org
Thu May 8 21:53:21 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,
.0000000000000001]
>>> sum(d)
2e-16
>>> d[0] + sum(d[1:])
0.0
/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>
<http://bugs.python.org/issue2792>
__________________________________
More information about the Python-bugs-list
mailing list