Title: A warning should be added to difflib documentation about SequenceMatcher performance · Issue #106865 · python/cpython · GitHub
Open Graph Title: A warning should be added to difflib documentation about SequenceMatcher performance · Issue #106865 · python/cpython
X Title: A warning should be added to difflib documentation about SequenceMatcher performance · Issue #106865 · python/cpython
Description: Documentation Some functions of difflib.SequenceMatcher perform very poorly in real-world scenarios (for example get_opcodes() takes several minutes to return a list of tuples for two identical files that are 70kb long). This is reported...
Open Graph Description: Documentation Some functions of difflib.SequenceMatcher perform very poorly in real-world scenarios (for example get_opcodes() takes several minutes to return a list of tuples for two identical fil...
X Description: Documentation Some functions of difflib.SequenceMatcher perform very poorly in real-world scenarios (for example get_opcodes() takes several minutes to return a list of tuples for two identical fil...
Opengraph URL: https://github.com/python/cpython/issues/106865
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"A warning should be added to difflib documentation about SequenceMatcher performance","articleBody":"# Documentation\r\n\r\nSome functions of [difflib.SequenceMatcher](https://docs.python.org/3/library/difflib.html?highlight=sequencematcher#) perform very poorly in real-world scenarios (for example get_opcodes() takes several minutes to return a list of tuples for two identical files that are 70kb long). This is reported in different places online, such as on [StackOverflow](https://stackoverflow.com/questions/25680947/pythons-difflib-sequencematcher-speed-up).\r\n\r\nIt would be nice to add a note about the performance in the doc, with possible workarounds (for example there is a great performance improvement if one opens the files with readlines() and compares two lists of lines, instead of opening files with read() and compare two strings).\r\n\r\nThanks :-)\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-106877\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/maathieu","@type":"Person","name":"maathieu"},"datePublished":"2023-07-18T14:22:57Z","url":"https://github.com/python/cpython/issues/106865"}
| 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:36f58a7c-e836-3379-5ea3-40e83901ef89 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C6B0:1DC4CC:1DEBBA3:27ABD1A:6B023687 |
| html-safe-nonce | d31e89df13a7108cefa0d579f2ca2805836a5ed7c1e32aaedb7f79f34fa2edc7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkIwOjFEQzRDQzoxREVCQkEzOjI3QUJEMUE6NkIwMjM2ODciLCJ2aXNpdG9yX2lkIjoiNzQ0NzQ3NDg2OTMxMjMwNDc3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b4d8320dbe1edcbc7230ba4748bab6dd23f917d3645f5449770738a6946b6a22 |
| hovercard-subject-tag | issue:1810043347 |
| 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/106865/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f7516c4d4669805bff5565e815406f2ab400fda4c233d0e23c0fdfc0f5a828e4/python/cpython/issues/106865 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f7516c4d4669805bff5565e815406f2ab400fda4c233d0e23c0fdfc0f5a828e4/python/cpython/issues/106865 |
| og:image:alt | Documentation Some functions of difflib.SequenceMatcher perform very poorly in real-world scenarios (for example get_opcodes() takes several minutes to return a list of tuples for two identical fil... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | maathieu |
| 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