Title: slow escaping of byte strings in Python 3 · Issue #366 · PyMySQL/PyMySQL · GitHub
Open Graph Title: slow escaping of byte strings in Python 3 · Issue #366 · PyMySQL/PyMySQL
X Title: slow escaping of byte strings in Python 3 · Issue #366 · PyMySQL/PyMySQL
Description: When I insert large blobs, e.g. a 10 MB byte string into a longblob field, it takes several seconds to prepare the value for insertion. Profiling indicates that most of that time is spent in the escape_bytes function in converters.py. He...
Open Graph Description: When I insert large blobs, e.g. a 10 MB byte string into a longblob field, it takes several seconds to prepare the value for insertion. Profiling indicates that most of that time is spent in the es...
X Description: When I insert large blobs, e.g. a 10 MB byte string into a longblob field, it takes several seconds to prepare the value for insertion. Profiling indicates that most of that time is spent in the es...
Opengraph URL: https://github.com/PyMySQL/PyMySQL/issues/366
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"slow escaping of byte strings in Python 3","articleBody":"When I insert large blobs, e.g. a 10 MB byte string into a longblob field, it takes several seconds to prepare the value for insertion. Profiling indicates that most of that time is spent in the `escape_bytes` function in `converters.py`. Here is that function for reference.\n\n``` python\ndef escape_bytes(value, mapping=None):\n # escape_bytes is calld only on Python 3.\n return escape_str(value.decode('ascii', 'surrogateescape'), mapping)\n```\n\nWhen I performed the same insertion through another interface, the escaping was about 100 times faster. \n\nIs there a way to speed this up?\n","author":{"url":"https://github.com/dimitri-yatsenko","@type":"Person","name":"dimitri-yatsenko"},"datePublished":"2015-08-12T17:40:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":27},"url":"https://github.com/366/PyMySQL/issues/366"}
| 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:7c60f82d-a8ca-5ff0-ddb1-cf7aabdc90d8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF1C:300650:99D26D:CECF82:6A56A2E5 |
| html-safe-nonce | 12782636b49e7238626c0a822e3e9ac17d3429051f637bd72a225c50eae90d20 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjFDOjMwMDY1MDo5OUQyNkQ6Q0VDRjgyOjZBNTZBMkU1IiwidmlzaXRvcl9pZCI6IjI5NzI4NTc0MzY0MzA4MzY0NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1e9650f0791a3fe6671b030786f0626a6d20102c372672fa40c11524b51aaa7c |
| hovercard-subject-tag | issue:100596016 |
| 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/PyMySQL/PyMySQL/366/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d443f0d6897ce9bc437973adcd237501077077af8b89a5d4202182a3c4264942/PyMySQL/PyMySQL/issues/366 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d443f0d6897ce9bc437973adcd237501077077af8b89a5d4202182a3c4264942/PyMySQL/PyMySQL/issues/366 |
| og:image:alt | When I insert large blobs, e.g. a 10 MB byte string into a longblob field, it takes several seconds to prepare the value for insertion. Profiling indicates that most of that time is spent in the es... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dimitri-yatsenko |
| hostname | github.com |
| expected-hostname | github.com |
| None | 13efe7fe8ecc41eda1078cbde8206041ed92bc54e29bcb737e9353dd9c407aad |
| turbo-cache-control | no-preview |
| go-import | github.com/PyMySQL/PyMySQL git https://github.com/PyMySQL/PyMySQL.git |
| octolytics-dimension-user_id | 5338312 |
| octolytics-dimension-user_login | PyMySQL |
| octolytics-dimension-repository_id | 2114213 |
| octolytics-dimension-repository_nwo | PyMySQL/PyMySQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2114213 |
| octolytics-dimension-repository_network_root_nwo | PyMySQL/PyMySQL |
| 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 | 5466ebe023a0abf876a1e6c5d7602ee8f5e6a02b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width