Title: Improve performance of `find_max_char` · Issue #122901 · python/cpython · GitHub
Open Graph Title: Improve performance of `find_max_char` · Issue #122901 · python/cpython
X Title: Improve performance of `find_max_char` · Issue #122901 · python/cpython
Description: Feature or enhancement Proposal: find_max_char is called each time a string is created. By reducing the amount of tests, the performance can be improved considerably. python -m pyperf timeit -s "b=('a' *1000+ '\u019f'*2)" "b[:-1]" +-----...
Open Graph Description: Feature or enhancement Proposal: find_max_char is called each time a string is created. By reducing the amount of tests, the performance can be improved considerably. python -m pyperf timeit -s "b=...
X Description: Feature or enhancement Proposal: find_max_char is called each time a string is created. By reducing the amount of tests, the performance can be improved considerably. python -m pyperf timeit -s &qu...
Opengraph URL: https://github.com/python/cpython/issues/122901
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve performance of `find_max_char`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\n`find_max_char` is called each time a string is created.\nBy reducing the amount of tests, the performance can be improved considerably.\n```\npython -m pyperf timeit -s \"b=('a' *1000+ '\\u019f'*2)\" \"b[:-1]\"\n```\n\n```\n+-----------+--------+----------------------+\n| Benchmark | ref | patch |\n+===========+========+======================+\n| timeit | 442 ns | 388 ns: 1.14x faster |\n+-----------+--------+----------------------+\n```\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-122902\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ruema","@type":"Person","name":"ruema"},"datePublished":"2024-08-11T12:14:46Z","url":"https://github.com/python/cpython/issues/122901"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2111068a-7665-1ffe-d1b6-646fc0fa366e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83A6:1CCECA:17FE208:1FDCAD6:6B021B62 |
| html-safe-nonce | 19d8418a14eed1dc0e19f32138124b331bc46bc23fe9c95e5f13ac928893a23a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0E2OjFDQ0VDQToxN0ZFMjA4OjFGRENBRDY6NkIwMjFCNjIiLCJ2aXNpdG9yX2lkIjoiODA2OTAzMDkyMjc5Nzg0OTQ0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1a970c2685e5e3c60167b902828586ad3a56e03db30dcffecab097c47fa3434c |
| hovercard-subject-tag | issue:2459567528 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/122901/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b554253d971d4201e895cff8cf495a0217946e60c44eaab070a26d94cf0a56b1/python/cpython/issues/122901 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b554253d971d4201e895cff8cf495a0217946e60c44eaab070a26d94cf0a56b1/python/cpython/issues/122901 |
| og:image:alt | Feature or enhancement Proposal: find_max_char is called each time a string is created. By reducing the amount of tests, the performance can be improved considerably. python -m pyperf timeit -s "b=... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ruema |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width