• 请不要在回答技术问题时复制粘贴 AI 生成的内容
netcan
V2EX  ›  程序员

C++20 协程机制性能测试结果

  •  
  •   netcan ·
    netcan · Dec 4, 2021 · 3960 views
    This topic created in 1798 days ago, the information mentioned may be changed or developed.
    7 replies  •  2021-12-04 17:57:55 +08:00
    byteli
    byteli
    Dec 4, 2021
    1
    支持
    Cu635
    Cu635
    Dec 4, 2021
    2
    点进去一看,还有个“原文地址”,为啥不是直接发 github.io 的博客链接呢……
    ysc3839
    ysc3839
    Dec 4, 2021 via Android
    3
    我觉得这么对比只是在对比具体 IO 库的性能,不能表示 C++ coroutine 这个特性本身的性能。
    C++ coroutine 的 co_await 像是回调函数的语法糖,co_yield 像是 generator 的语法糖。应该和不用 coroutine 实现的回调函数或 generator 做对比。
    netcan
    netcan
    OP
    Dec 4, 2021
    4
    @Cu635 因为墙可能不稳定。
    netcan
    netcan
    OP
    Dec 4, 2021
    5
    @ysc3839 目的是为了测试协程对 IO 场景有没有性能影响,目前没有什么数据支撑,全靠理论推测的。
    netcan
    netcan
    OP
    Dec 4, 2021
    6
    @ysc3839 "应该和不用 coroutine 实现的回调函数或 generator 做对比。",所以我和 libuv/对比,它们通常是回调形式的。
    ysc3839
    ysc3839
    Dec 4, 2021 via Android
    7
    @netcan 这么对比没有做到控制变量,就算要对比 IO 场景下的性能差异,也应该和同一个库使用回调函数做对比。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4809 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:21 · PVG 16:21 · LAX 00:21 · JFK 03:21
    ♥ Do have faith in what you're doing.