[issue21644] Optimize bytearray(int) constructor to use calloc()

2021-11-14 Thread Bruce Merry
Bruce Merry added the comment: > I abandonned the issue because I didn't have time to work on it. If you want, > you can open a new issue for that. If I make a pull request and run some microbenchmarks, will you (or some other core dev) have time to review it? I've had a bad experience

[issue21644] Optimize bytearray(int) constructor to use calloc()

2021-11-08 Thread STINNER Victor
STINNER Victor added the comment: I abandonned the issue because I didn't have time to work on it. If you want, you can open a new issue for that. -- ___ Python tracker ___

[issue21644] Optimize bytearray(int) constructor to use calloc()

2020-09-15 Thread Bruce Merry
Bruce Merry added the comment: Was this abandoned just because nobody had the time, or was there a problem with the approach? I independently wanted this optimisation, and have ended up implementing something very similar to what was reverted in https://hg.python.org/lookup/dff6b4b61cac.

[issue21644] Optimize bytearray(int) constructor to use calloc()

2015-03-18 Thread STINNER Victor
STINNER Victor added the comment: I'm not interested to work on this optimization, so I just close the issue. -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21644

[issue21644] Optimize bytearray(int) constructor to use calloc()

2014-07-22 Thread STINNER Victor
STINNER Victor added the comment: See also issue #22030 (set). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21644 ___ ___ Python-bugs-list

[issue21644] Optimize bytearray(int) constructor to use calloc()

2014-06-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Responding to a comment in issue21233: Before: === x = bytearray(0) m = memoryview(x) x.__init__(10) Traceback (most recent call last): File stdin, line 1, in module BufferError: Existing exports

[issue21644] Optimize bytearray(int) constructor to use calloc()

2014-06-02 Thread STINNER Victor
New submission from STINNER Victor: Python 3.5 has a new PyObject_Calloc() function which can be used for fast memory allocation of memory block initialized with zeros. I already implemented an optimization, but Stefan Krah found issues in my change:

[issue21644] Optimize bytearray(int) constructor to use calloc()

2014-06-02 Thread STINNER Victor
STINNER Victor added the comment: Stefan also wrote: 3) Somewhat similarly, I wonder if it was necessary to refactor PyBytes_FromStringAndSize(). I find the new version more difficult to understand. This issue can also be addressed here. --

[issue21644] Optimize bytearray(int) constructor to use calloc()

2014-06-02 Thread STINNER Victor
STINNER Victor added the comment: Stefan wrote: 3) Somewhat similarly, I wonder if it was necessary to refactor PyBytes_FromStringAndSize(). I find the new version more difficult to understand. Do you mean that the optimization is useless or that the implementation should be changed?