[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Should this be backported? IMO, it is a bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___ ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Zachary for fixing this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___ ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16d0e3dda31c by Zachary Ware in branch 'default': Issue #23488: Fix a syntax error on big endian platforms. https://hg.python.org/cpython/rev/16d0e3dda31c -- ___ Python tracker rep...@bugs.python.org

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is good to go. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___ ___ Python-bugs-list mailing

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: This would have gone quicker if the size bug-fix hadn't been commingled with the optimization. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4b5461dcd190 by Serhiy Storchaka in branch 'default': Issue #23488: Random generator objects now consume 2x less memory on 64-bit. https://hg.python.org/cpython/rev/4b5461dcd190 -- nosy: +python-dev ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___ ___ Python-bugs-list mailing list

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-05-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: You should fix the comment as mentioned in the review, otherwise looks good to me. -- assignee: rhettinger - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch addresses some Victor's comments. -- Added file: http://bugs.python.org/file38707/random_uint32_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-27 Thread Mark Dickinson
Mark Dickinson added the comment: see my old issue #17884 ... and you can also re-read my explanations in that issue about why simply using uint32_t and int32_t doesn't work! We need something like PY_UINT32_T (and co) for portability. The only part of #17884 that's still valid is that it

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry, here is it. -- keywords: +patch Added file: http://bugs.python.org/file38208/random_uint32.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Some microbenchmark results on 32-bit Linux: $ ./python -m timeit -s from random import getrandbits -- getrandbits(64) Before: 100 loops, best of 3: 1.41 usec per loop After: 100 loops, best of 3: 1.34 usec per loop $ ./python -m timeit -s from

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. For utint32_t, see my old issue #17884: Try to reuse stdint.h types like int32_t. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-22 Thread Mark Dickinson
Mark Dickinson added the comment: Here is a patch. Where?! BYW, we might want to use PY_UINT32_T rather than uint32_t directly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread STINNER Victor
STINNER Victor added the comment: Oh, by the way, using 32 bits unsigned integers would avoid all the 0x everywhere. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread STINNER Victor
STINNER Victor added the comment: The (unsigned long) declaration should probably be replaced with (uint32_t) Would it be possible to benchmark this change, to ensure that it doesn't kill performances? A quick micro-benchmark using timeit should be enough ;) I agree with the change, I

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, I noticed this when reimplementing the random module in Numba. *Theoretically*, I think you need long to ensure ints are at least 32 bits. But in practice, I think CPython already needs 32-bit C ints. (note Numpy also uses C longs internally) Would it

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- versions: -Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___ ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread Raymond Hettinger
New submission from Raymond Hettinger: The Modules/_randommodule.c implements the 32-bit version of the MersenneTwister and its struct uses (unsigned long) for each of the 624 elements of the state vector. On a 32-bit build, the unsigned longs are 4 bytes. However, on a 64-bit build, they

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- components: +Extension Modules ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488 ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. It also optimizes getrandbit() and seed() as was originally proposed in issue16496. -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23488