V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
daimiaopeng
V2EX  ›  问与答

用 c++写的 Python http 请求模块,速度极快

  •  
  •   daimiaopeng · 2020-04-15 19:39:47 +08:00 · 1095 次点击
    这是一个创建于 1465 天前的主题,其中的信息可能已经有所发展或是发生改变。

    github 项目: https://github.com/daimiaopeng/fast_requests 项目是今天写的所以很简陋,暂且只支持 get 。

    测试: 循环 get("https://baidu.com") 100 次

    1.自己写的 4.2 秒

    2.requests 10.5 秒

    3.grequests 31.3 秒

    2 条回复    2020-04-15 20:11:19 +08:00
    daimiaopeng
        1
    daimiaopeng  
    OP
       2020-04-15 19:56:21 +08:00
    好像投错区了,尴尬
    unixeno
        2
    unixeno  
       2020-04-15 20:11:19 +08:00 via Android
    建议本地开 web 服务器测试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1070 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 23:05 · PVG 07:05 · LAX 16:05 · JFK 19:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.