[issue46235] Do all ref-counting at once for sequence multiplication

Dennis Sweeney report at bugs.python.org
Sun Jan 2 19:19:50 EST 2022


Dennis Sweeney <sweeney.dennis650 at gmail.com> added the comment:

# benchmarking script

from pyperf import Runner
runner = Runner()

for n in [2, 10, 100, 10_000]:
    for A in [
        '[None]',
        '["Python", "Perl"]',
        'list(range(10))',
        'list(range(100))',
        'list(range(1000))',
        '(None,)',
        '("Python", "Perl")',
        'tuple(range(10))',
        'tuple(range(100))',
        'tuple(range(1000))',
    ]:
        runner.timeit(    
            name=f"{A} * {n}",
            setup=f"x = {A}",
            stmt=f"x * {n}",
        )

----------

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


More information about the Python-bugs-list mailing list