[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-08 Thread Yury Selivanov
Yury Selivanov added the comment: I'm not sure why this issue is open... Closing it. -- status: open -> closed ___ Python tracker ___

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-07 Thread Stefan Krah
Stefan Krah added the comment: Well I *did* run the decimal/float milli-benchmark now and it shows at least 15% improvement for floats consistently. Given that the official benchmark suite does not seem to be very stable either (#21955), I actually prefer small and well-understood benchmarks.

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-07 Thread Stefan Krah
Stefan Krah added the comment: The comment looks good to me -- I'll stay out of the benchmarking issue, I didn't check any of that. :) -- ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset cfb77ccdc23a by Yury Selivanov in branch 'default': Issue #26288: Fix comment https://hg.python.org/cpython/rev/cfb77ccdc23a -- ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Yury Selivanov
Yury Selivanov added the comment: > Sorry, I was a bit brief: The current comment says "decimal" instead of > "double". It should be changed to "double". Oh, got it now, sorry. I rephrased the comment a bit, hopefully it's better now. Please check. Thanks! --

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, let me refine that. nbody and spectral-norm don't make sense for people running CPython. Perhaps people running PyPy might care about their performance... (though PyPy is supposed to support a subset of Numpy too) --

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Stefan Krah
Stefan Krah added the comment: Sorry, I was a bit brief: The current comment says "decimal" instead of "double". It should be changed to "double". -- ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 06/02/2016 18:07, Yury Selivanov a écrit : > >> Actually, please fix the comment. We don't want someone wondering what those >> "macro-benchmarks" are. > > If spectral-norm and nbody aren't good benchmarks then let's remove > them from our benchmarks

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Yury Selivanov
Yury Selivanov added the comment: > Actually, please fix the comment. We don't want someone wondering what those > "macro-benchmarks" are. If spectral-norm and nbody aren't good benchmarks then let's remove them from our benchmarks suite. I'll remove that comment anyways, as it doesn't make

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Stefan Krah
Stefan Krah added the comment: Additionally, "single digit will always fit a double"? -- nosy: +skrah ___ Python tracker ___

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: Nice enhancement. /* Fast path; single digit will always fit decimal. This improves performance of FP/long operations by at least 20%. This is even visible on macro-benchmarks. */ I'm not sure that "spectral_norm" can be qualified as macro-benchmark.

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 986184c355e8 by Yury Selivanov in branch 'default': Issue #26288: Optimize PyLong_AsDouble. https://hg.python.org/cpython/rev/986184c355e8 -- nosy: +python-dev ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks a lot for the review, Serhiy! -- resolution: -> fixed stage: -> resolved status: open -> closed type: -> performance ___ Python tracker

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-04 Thread Yury Selivanov
New submission from Yury Selivanov: The attached patch drastically speeds up PyLong_AsDouble for single digit longs: -m timeit -s "x=2" "x*2.2 + 2 + x*2.5 + 1.0 - x / 2.0 + (x+0.1)/(x-0.1)*2 + (x+10)*(x-30)" with patch: 0.414 without: 0.612 spectral_norm: 1.05x faster.The results are