[issue28621] Refactor duplicate code calculating digit's bit length

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +845

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Adrian for your contribution.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1940b72b0a02 by Serhiy Storchaka in branch 'default':
Issue #28621: Sped up converting int to float by reusing faster bits counting
https://hg.python.org/cpython/rev/1940b72b0a02

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-07 Thread Mark Dickinson

Mark Dickinson added the comment:

LGTM, too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
nosy: +serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-05 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +mark.dickinson
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-05 Thread Adrian Wielgosik

Changes by Adrian Wielgosik :


--
keywords: +patch
Added file: http://bugs.python.org/file45367/bit_length.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28621] Refactor duplicate code calculating digit's bit length

2016-11-05 Thread Adrian Wielgosik

New submission from Adrian Wielgosik:

The attached patch uses an existing function bits_in_digit() in two other 
functions:

- in long_bit_length() - it already had identical logic
- in _PyLong_NumBits() - it used a naive, slower way of calculating bit length, 
so as an added bonus the patch speeds it up a bit. It's visible in float-long 
comparison microbenchmark:

$ ./old -m timeit "1 == 1.0"
500 loops, best of 5: 55 nsec per loop

$ ./new -m timeit "1 == 1.0"
500 loops, best of 5: 52.3 nsec per loop

$ ./old -m timeit "12345678 == 12345678.0"
500 loops, best of 5: 70.4 nsec per loop

$ ./new -m timeit "12345678 == 12345678.0"
500 loops, best of 5: 53.5 nsec per loop

--
components: Interpreter Core
messages: 280123
nosy: Adrian Wielgosik
priority: normal
severity: normal
status: open
title: Refactor duplicate code calculating digit's bit length
type: performance
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com