[New-bugs-announce] [issue46993] Speed up bytearray creation from list and tuple

Kumar Aditya report at bugs.python.org
Sat Mar 12 04:40:17 EST 2022


New submission from Kumar Aditya <rahuladitya303 at gmail.com>:

The attached PR speeds up bytearray creation from list and tuple.

Benchmark (uses pyperf):
-----------------------------------------------------
import pyperf

runner = pyperf.Runner()
runner.timeit(name="bench bytearray",
              stmt="bytearray([42]*10000)",)
-----------------------------------------------------

Results:

-----------------------------------------------------
Mean +- std dev: [base] 74.8 us +- 5.5 us -> [patch] 53.2 us +- 3.3 us: 1.41x faster
-----------------------------------------------------

----------
components: Interpreter Core
messages: 414987
nosy: gvanrossum, kumaraditya303
priority: normal
pull_requests: 29935
severity: normal
status: open
title: Speed up bytearray creation from list and tuple
type: performance
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46993>
_______________________________________


More information about the New-bugs-announce mailing list