[issue47070] Improve performance of array_inplace_repeat

2022-03-28 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset 850687df47b03e98c1433e6e70e71a8921eb4454 by Pieter Eendebak in branch 'main': bpo-47070: Add _PyBytes_Repeat() (GH-31999) https://github.com/python/cpython/commit/850687df47b03e98c1433e6e70e71a8921eb4454 -- ___

[issue47070] Improve performance of array_inplace_repeat

2022-03-19 Thread Dennis Sweeney
Dennis Sweeney added the comment: I'd bet we could add a couple of utility functions that could be used in multiple places, to keep the "trick" all in one place. Something like void _PyBytes_RepeatInPlace(char **buffer, size_t start_len, size_t end_len) { // Repeatedly double. size_t

[issue47070] Improve performance of array_inplace_repeat

2022-03-19 Thread Pieter Eendebak
Change by Pieter Eendebak : -- keywords: +patch pull_requests: +30088 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31999 ___ Python tracker ___

[issue47070] Improve performance of array_inplace_repeat

2022-03-19 Thread Pieter Eendebak
New submission from Pieter Eendebak : The array_inplace_repeat is inefficient for small arrays and a high number of repeats. This can be improved by using the same approach as in https://bugs.python.org/issue47005 -- components: Interpreter Core messages: 415572 nosy: pieter.eendebak