Title: str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions) · Issue #65317 · python/cpython · GitHub
Open Graph Title: str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions) · Issue #65317 · python/cpython
X Title: str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions) · Issue #65317 · python/cpython
Description: BPO 21118 Nosy @pitrou, @vstinner, @ezio-melotti, @serhiy-storchaka, @MojoVampire Files translate_timing.py: File to time various ways of using str.translate and its "competing" functionstranslate_writer.patchtranslate_script.pytranslate...
Open Graph Description: BPO 21118 Nosy @pitrou, @vstinner, @ezio-melotti, @serhiy-storchaka, @MojoVampire Files translate_timing.py: File to time various ways of using str.translate and its "competing" functionstranslate_...
X Description: BPO 21118 Nosy @pitrou, @vstinner, @ezio-melotti, @serhiy-storchaka, @MojoVampire Files translate_timing.py: File to time various ways of using str.translate and its "competing" functions...
Opengraph URL: https://github.com/python/cpython/issues/65317
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)","articleBody":"BPO | [21118](https://bugs.python.org/issue21118)\n--- | :---\nNosy | @pitrou, @vstinner, @ezio-melotti, @serhiy-storchaka, @MojoVampire\nFiles | \u003cli\u003e[translate_timing.py](https://bugs.python.org/file34688/translate_timing.py \"Uploaded as text/plain at 2014-03-31.23:09:05 by @MojoVampire\"): File to time various ways of using str.translate and its \"competing\" functions\u003c/li\u003e\u003cli\u003e[translate_writer.patch](https://bugs.python.org/file34691/translate_writer.patch \"Uploaded as text/plain at 2014-04-01.08:23:35 by @vstinner\")\u003c/li\u003e\u003cli\u003e[translate_script.py](https://bugs.python.org/file34727/translate_script.py \"Uploaded as text/plain at 2014-04-04.17:29:33 by @vstinner\")\u003c/li\u003e\u003cli\u003e[translate_writer_bench.txt](https://bugs.python.org/file34728/translate_writer_bench.txt \"Uploaded as text/plain at 2014-04-04.17:30:05 by @vstinner\")\u003c/li\u003e\u003cli\u003e[fast_translate.patch](https://bugs.python.org/file34731/fast_translate.patch \"Uploaded as text/plain at 2014-04-04.23:38:28 by @vstinner\")\u003c/li\u003e\u003cli\u003e[translate_script_ascii.py](https://bugs.python.org/file34732/translate_script_ascii.py \"Uploaded as text/plain at 2014-04-04.23:43:34 by @vstinner\")\u003c/li\u003e\u003cli\u003e[translate_cached.patch](https://bugs.python.org/file34734/translate_cached.patch \"Uploaded as text/plain at 2014-04-05.11:47:42 by @serhiy-storchaka\")\u003c/li\u003e\u003cli\u003e[translate_cached_2.patch](https://bugs.python.org/file34736/translate_cached_2.patch \"Uploaded as text/plain at 2014-04-05.12:51:09 by @serhiy-storchaka\")\u003c/li\u003e\u003cli\u003e[bench_translate.py](https://bugs.python.org/file34744/bench_translate.py \"Uploaded as text/plain at 2014-04-07.08:34:40 by @vstinner\")\u003c/li\u003e\n\n\u003csup\u003e*Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.*\u003c/sup\u003e\n\n\u003cdetails\u003e\u003csummary\u003eShow more details\u003c/summary\u003e\u003cp\u003e\n\nGitHub fields:\n```python\nassignee = None\nclosed_at = \u003cDate 2014-04-05.13:03:50.934\u003e\ncreated_at = \u003cDate 2014-03-31.23:09:06.297\u003e\nlabels = ['expert-unicode', 'performance']\ntitle = 'str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)'\nupdated_at = \u003cDate 2014-04-08.07:14:31.298\u003e\nuser = 'https://github.com/MojoVampire'\n```\n\nbugs.python.org fields:\n```python\nactivity = \u003cDate 2014-04-08.07:14:31.298\u003e\nactor = 'python-dev'\nassignee = 'none'\nclosed = True\nclosed_date = \u003cDate 2014-04-05.13:03:50.934\u003e\ncloser = 'vstinner'\ncomponents = ['Unicode']\ncreation = \u003cDate 2014-03-31.23:09:06.297\u003e\ncreator = 'josh.r'\ndependencies = []\nfiles = ['34688', '34691', '34727', '34728', '34731', '34732', '34734', '34736', '34744']\nhgrepos = []\nissue_num = 21118\nkeywords = ['patch']\nmessage_count = 31.0\nmessages = ['215283', '215301', '215339', '215387', '215473', '215538', '215539', '215540', '215541', '215551', '215552', '215553', '215576', '215577', '215586', '215587', '215594', '215598', '215599', '215600', '215602', '215606', '215610', '215612', '215673', '215676', '215678', '215680', '215685', '215686', '215742']\nnosy_count = 6.0\nnosy_names = ['pitrou', 'vstinner', 'ezio.melotti', 'python-dev', 'serhiy.storchaka', 'josh.r']\npr_nums = []\npriority = 'normal'\nresolution = 'fixed'\nstage = 'patch review'\nstatus = 'closed'\nsuperseder = None\ntype = 'performance'\nurl = 'https://bugs.python.org/issue21118'\nversions = ['Python 3.4', 'Python 3.5']\n```\n\n\u003c/p\u003e\u003c/details\u003e\n","author":{"url":"https://github.com/MojoVampire","@type":"Person","name":"MojoVampire"},"datePublished":"2014-03-31T23:09:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":31},"url":"https://github.com/65317/cpython/issues/65317"}
| 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:e7d7c118-6c60-5a5c-8ea7-dc5f355090ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB3A:B5AA6:69B1258:93DB2DF:6A5041C1 |
| html-safe-nonce | 36d2b3da95ff8848c1ea48fe1364d073f986690cab4f99695e8dfc72bad8dab5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjNBOkI1QUE2OjY5QjEyNTg6OTNEQjJERjo2QTUwNDFDMSIsInZpc2l0b3JfaWQiOiI3MjQwNzExNzcyMTIxODc0ODgxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 77503a9626182d4d9e998c9d390f53649698ccbf8173b986297a9b9041dc1a9b |
| hovercard-subject-tag | issue:1198918506 |
| 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/65317/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f530ab0b6a38854d837f72d8928761e8811d131aa8c54af6740767181dbc18b0/python/cpython/issues/65317 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f530ab0b6a38854d837f72d8928761e8811d131aa8c54af6740767181dbc18b0/python/cpython/issues/65317 |
| og:image:alt | BPO 21118 Nosy @pitrou, @vstinner, @ezio-melotti, @serhiy-storchaka, @MojoVampire Files translate_timing.py: File to time various ways of using str.translate and its "competing" functionstranslate_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MojoVampire |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width