Go 同步发HTTP请求是不是要比Python慢很多?

imikay · · 2276 次点击
buscoop
纸上得来终觉浅,绝知此事要躬行!
晕死,chan 为啥用unbuffered
#6
更多评论
你python写的怎么是`post`方法,应该是`get`方法,我测试了一下修改为`get`后,python耗时2s+,go耗时0.2+,基本上耗时python是go的10倍 ```python async def fetch(session, url): async with session.get(url) as response: return await response.text() ```
#1
哦,应该是get,我之前改来改去这个地方忘记改回去了,我再跑下试试
#2