Title: base64.b85encode uses significant amount of RAM · Issue #101178 · python/cpython · GitHub
Open Graph Title: base64.b85encode uses significant amount of RAM · Issue #101178 · python/cpython
X Title: base64.b85encode uses significant amount of RAM · Issue #101178 · python/cpython
Description: Bug report On the same string: b64encode: RAM: 604MB, CPU: 79%, Time taken: 1.18sec and gave a result b85encode: RAM: 6.9GB, CPU: 64%, Time taken: 45sec and crashed due to insufficient RAM (most likely) b85encode takes up my entire RAM a...
Open Graph Description: Bug report On the same string: b64encode: RAM: 604MB, CPU: 79%, Time taken: 1.18sec and gave a result b85encode: RAM: 6.9GB, CPU: 64%, Time taken: 45sec and crashed due to insufficient RAM (most li...
X Description: Bug report On the same string: b64encode: RAM: 604MB, CPU: 79%, Time taken: 1.18sec and gave a result b85encode: RAM: 6.9GB, CPU: 64%, Time taken: 45sec and crashed due to insufficient RAM (most li...
Opengraph URL: https://github.com/python/cpython/issues/101178
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"base64.b85encode uses significant amount of RAM","articleBody":"# Bug report\r\n\r\nOn the same string:\r\n - b64encode: RAM: 604MB, CPU: 79%, Time taken: 1.18sec and gave a result\r\n - b85encode: RAM: 6.9GB, CPU: 64%, Time taken: 45sec and crashed due to insufficient RAM (most likely)\r\n\r\nb85encode takes up my entire RAM and crashes\r\n\r\nOn IPython:\r\n```\r\nIn [1]: import base64\r\n\r\nIn [2]: contents = b'a' * 250 * 1024 * 1024\r\n\r\nIn [3]: %time len(base64.b64encode(contents).decode(\"ascii\")) / 1024 / 1024\r\nCPU times: user 489 ms, sys: 414 ms, total: 904 ms\r\nWall time: 974 ms\r\nOut[3]: 333.33333587646484\r\n\r\nIn [4]: %time len(base64.b85encode(contents).decode(\"ascii\")) / 1024 / 1024\r\nKilled\r\n```\r\n\r\nHere is the GNU time stats:\r\n```\r\n$ /usr/bin/time /opt/python3.9/bin/python -c \"import base64; print(len(base64.b64encode(b'a' * 250 * 1024 * 1024)) / 1024 / 1024)\"\r\n333.33333587646484\r\n0.55user 0.39system 0:01.18elapsed 79%CPU (0avgtext+0avgdata 604008maxresident)k\r\n0inputs+0outputs (0major+151155minor)pagefaults 0swaps\r\n\r\n$ /usr/bin/time /opt/python3.9/bin/python -c \"import base64; print(len(base64.b85encode(b'a' * 250 * 1024 * 1024)) / 1024 / 1024)\"\r\n26.08user 3.39system 0:45.86elapsed 64%CPU (0avgtext+0avgdata 6966080maxresident)k\r\n512inputs+0outputs (2major+1756895minor)pagefaults 0swaps\r\n```\r\n\r\nI have gotten same results in Python 3.6, 3.7, 3.8, 3.9\r\n\r\n# Your environment\r\n\r\n- CPython versions tested on: Python 3.9 installed with miniconda\r\n- Operating system and architecture: CentOS 7, AWS t3.large machine\r\n\r\n\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102753\n* gh-112248\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/AbdealiLoKo","@type":"Person","name":"AbdealiLoKo"},"datePublished":"2023-01-20T06:27:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/101178/cpython/issues/101178"}
| 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:1ce57b36-6e2d-8099-9074-b58cd63a67ae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B29A:2D943D:C202F2:10FF0B4:696A2197 |
| html-safe-nonce | 3c3ae145db368ccbef55a30c393544ba9e68181372b164b5d4553df50f3a5611 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjlBOjJEOTQzRDpDMjAyRjI6MTBGRjBCNDo2OTZBMjE5NyIsInZpc2l0b3JfaWQiOiIxMTQ2Mzc4NTkxODUxMzg5MzM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 78c8827d22e91ae9dcabb0038988cd11242b178f95a1e6e23967327ba0ffdda6 |
| hovercard-subject-tag | issue:1550367829 |
| 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/101178/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f0f946c1149f3c8c6eb7e08605607f0d4ffa14e644a0c49db0678b5282dc6cb0/python/cpython/issues/101178 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f0f946c1149f3c8c6eb7e08605607f0d4ffa14e644a0c49db0678b5282dc6cb0/python/cpython/issues/101178 |
| og:image:alt | Bug report On the same string: b64encode: RAM: 604MB, CPU: 79%, Time taken: 1.18sec and gave a result b85encode: RAM: 6.9GB, CPU: 64%, Time taken: 45sec and crashed due to insufficient RAM (most li... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AbdealiLoKo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 014f3d193f36b7d393f88ca22d06fbacd370800b40a547c1ea67291e02dc8ea3 |
| 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 | d515f6f09fa57a93bf90355cb894eb84ca4f458f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width