| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Benchmark: import pyperf
runner = pyperf.Runner()
for list_size in ('10', '10**3', '10**6'):
runner.timeit(
f'short items: {list_size}',
setup=f"data=[b'x']*{list_size}; sep=b'.'",
stmt="sep.join(data)")
for list_size in ('10', '10**2', '10**4'):
runner.timeit(
f'long items: {list_size}',
setup=f"data=[b'x' * 100]*{list_size}; sep=b'.'",
stmt="sep.join(data)")Results on Fedora 44 with CPU isolation:
Benchmark hidden because not significant (1): long items: 10**4 |
Sorry, something went wrong.
|
See also #158693 which optimizes PyUnicode_Join(). |
Sorry, something went wrong.
There was a problem hiding this comment.
Small change and a nice improvement. While investigating this I found there are larger gains possible in case of exact bytes (the common case?), but also a bug in the FT build (I created #158803).
Sorry, something went wrong.
|
Merged, thanks for your review @eendebakpt.
Do you mean not avoiding Py_buffer or something else? If you have an idea, please propose a pull request with a benchmark and put me in copy. I will review it :-) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.