Title: stdin.drain is very slow on some platforms · Issue #384 · python/asyncio · GitHub
Open Graph Title: stdin.drain is very slow on some platforms · Issue #384 · python/asyncio
X Title: stdin.drain is very slow on some platforms · Issue #384 · python/asyncio
Description: I'm on Python 3.5.2, with the following code: #!/usr/bin/env python3 import asyncio import time import logging logging.basicConfig(level='DEBUG') async def drain_time(length): proc = await asyncio.create_subprocess_exec('/bin/cat', stdin...
Open Graph Description: I'm on Python 3.5.2, with the following code: #!/usr/bin/env python3 import asyncio import time import logging logging.basicConfig(level='DEBUG') async def drain_time(length): proc = await asyncio....
X Description: I'm on Python 3.5.2, with the following code: #!/usr/bin/env python3 import asyncio import time import logging logging.basicConfig(level='DEBUG') async def drain_time(length): proc = aw...
Opengraph URL: https://github.com/python/asyncio/issues/384
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stdin.drain is very slow on some platforms","articleBody":"I'm on Python 3.5.2, with the following code:\n\n``` python\n#!/usr/bin/env python3\n\nimport asyncio\nimport time\nimport logging\n\nlogging.basicConfig(level='DEBUG')\n\nasync def drain_time(length):\n proc = await asyncio.create_subprocess_exec('/bin/cat',\n stdin=asyncio.subprocess.PIPE,\n stdout=asyncio.subprocess.DEVNULL,\n stderr=asyncio.subprocess.DEVNULL,\n )\n\n data = b'0' * length\n proc.stdin.write(data)\n t0 = time.time()\n await proc.stdin.drain()\n r = time.time() - t0\n proc.stdin.close()\n await proc.wait()\n return r\n\nasync def main():\n for i in range(5, 17):\n for j in range(1, 2):\n size = j * 10**i\n print('{:.0e}'.format(size), await drain_time(size))\n\nasyncio.get_event_loop().run_until_complete(main())\n```\n\non an Ubuntu server (this seems ok)\n\n```\nDEBUG:asyncio:Using selector: EpollSelector\n1e+05 7.3909759521484375e-06\n2e+05 6.4373016357421875e-06\n3e+05 0.000118255615234375\n1e+06 0.0002932548522949219\n2e+06 0.0005526542663574219\n3e+06 0.0019674301147460938\n1e+07 0.023283720016479492\n2e+07 0.004916667938232422\n3e+07 0.16347408294677734\n1e+08 0.024138450622558594\n2e+08 0.04891180992126465\n3e+08 0.07430100440979004\n```\n\non an Archlinux: (more or less ok)\n\n```\nDEBUG:asyncio:Using selector: EpollSelector\n1e+05 5.245208740234375e-06\n2e+05 4.291534423828125e-06\n3e+05 8.797645568847656e-05\n1e+06 0.0005102157592773438\n2e+06 0.0015668869018554688\n3e+06 0.0022423267364501953\n1e+07 0.01090097427368164\n2e+07 0.1207735538482666\n3e+07 0.2826368808746338\n1e+08 0.8428807258605957\n2e+08 0.029124975204467773\n3e+08 3.3120124340057373\n1e+09 2.904399871826172\n2e+09 13.772144079208374\n3e+09 16.17424488067627\n```\n\non osx: (not ok)\n\n```\nDEBUG:asyncio:Using selector: KqueueSelector\n1e+05 0.0005750656127929688\n2e+05 0.0010769367218017578\n3e+05 0.005205869674682617\n1e+06 0.007627964019775391\n2e+06 0.022066831588745117\n3e+06 0.05894899368286133\n1e+07 1.633073091506958\n2e+07 6.287441968917847\n3e+07 15.285433053970337\n1e+08 178.50560998916626\n```\n\nAny idea what could be causing this?\n","author":{"url":"https://github.com/arthurdarcet","@type":"Person","name":"arthurdarcet"},"datePublished":"2016-07-22T09:06:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/384/asyncio/issues/384"}
| 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:34ee2f4b-68d5-cf6f-5814-b560da4f6b21 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C15A:26A866:111FDE2:17FE1D2:696A3A04 |
| html-safe-nonce | 5f4ecee2e314807bda048663b868698432dd98f63aa9885d610e060a8f851fd1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTVBOjI2QTg2NjoxMTFGREUyOjE3RkUxRDI6Njk2QTNBMDQiLCJ2aXNpdG9yX2lkIjoiODg5MjI5NzY1MDAwMjA4MjMwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b487636023126931072ea9c7f1ee94dc6736f9b82e5a8780f2b51f7735ae79ed |
| hovercard-subject-tag | issue:167001865 |
| 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/asyncio/384/issue_layout |
| twitter:image | https://opengraph.githubassets.com/20fefb6382199f6759fd7543e3ca51c51f7c2f54c473a1a65c2e2f5757b5f69d/python/asyncio/issues/384 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/20fefb6382199f6759fd7543e3ca51c51f7c2f54c473a1a65c2e2f5757b5f69d/python/asyncio/issues/384 |
| og:image:alt | I'm on Python 3.5.2, with the following code: #!/usr/bin/env python3 import asyncio import time import logging logging.basicConfig(level='DEBUG') async def drain_time(length): proc = await asyncio.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arthurdarcet |
| hostname | github.com |
| expected-hostname | github.com |
| None | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/asyncio git https://github.com/python/asyncio.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 33739295 |
| octolytics-dimension-repository_nwo | python/asyncio |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33739295 |
| octolytics-dimension-repository_network_root_nwo | python/asyncio |
| 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 | 7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width