{"id":341175,"date":"2021-02-16T09:13:17","date_gmt":"2021-02-16T01:13:17","guid":{"rendered":"http:\/\/4563.org\/?p=341175"},"modified":"2021-02-16T09:13:17","modified_gmt":"2021-02-16T01:13:17","slug":"go-%e7%9a%84%e5%b9%b6%e5%8f%91%e6%a8%a1%e5%9e%8b%e7%9a%84%e4%b8%80%e4%ba%9b%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=341175","title":{"rendered":"Go \u7684\u5e76\u53d1\u6a21\u578b\u7684\u4e00\u4e9b\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Go \u7684\u5e76\u53d1\u6a21\u578b\u7684\u4e00\u4e9b\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bushenx <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u6700\u8fd1\u5728\u4f18\u5316\u4e1a\u52a1\u4e0a\u7684\u4e00\u5757\u529f\u80fd\uff0c\u73b0\u9636\u6bb5\u8fd9\u4e2a\u529f\u80fd\u4f1a\u5bf9\u7528\u6237\u7684\u6bcf\u4e2a\u8bf7\u6c42\u65b0\u5efa\u4e00\u4e2a\u534f\u7a0b\u5904\u7406\uff0c\u4f46\u662f\u4e2a\u4eba\u611f\u89c9\u8fd9\u6837\u65e0\u8282\u5236\u7684\u4f7f\u7528\u534f\u7a0b\u6709\u4e9b\u4e0d\u59a5\u3002\u60f3\u5728\u8fd9\u4e0a\u9762\u4f18\u5316\u4e00\u4e0b\uff0c\u6bd4\u5982\u9650\u5236\u7528\u6237\u65b0\u5efa\u534f\u7a0b\u7684\u6570\u91cf\u3002\u6709\u8fd9\u4e2a\u60f3\u6cd5\u4f46\u662f\u5177\u4f53\u5b9e\u73b0\u5e94\u8be5\u5982\u4f55\u505a\uff1f\u6709\u4ec0\u4e48\u4e66\u7c4d\u6216\u8005\u6587\u7ae0\u4ecb\u7ecd\u7c7b\u4f3c\u8fd9\u6837\u534f\u7a0b\u5e76\u53d1\u6a21\u578b\u7684\uff0c\u53ef\u4ee5\u63a8\u8350\u5b66\u4e60\u4e00\u4e0b\u5417\uff1f      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>15<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5269717\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pythonnoob <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u76f4\u63a5\u7528\u6d88\u606f\u961f\u5217\u524a\u8c37\u5e73\u5cf0\uff0c\u6216\u8005\u7528\u4ee4\u724c\u6876\u9650\u5236\u6570\u91cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269718\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bushenx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pythonnoob \u4ee4\u724c\u6876\u6709\u4f7f\u7528\uff0c\u4f46\u662f\u60f3\u5728\u534f\u7a0b\u521b\u5efa\u7684\u5730\u65b9\u4e5f\u63a7\u5236\u4e00\u4e0b\u534f\u7a0b\u7684\u5e76\u53d1\u6570\u91cf\uff0c\u53ef\u4ee5\u7ed9\u652f\u4e2a\u62db\u6216\u8005\u6709\u4ec0\u4e48\u522b\u7684\u6e20\u9053\u5b66\u4e60\u4e00\u4e0b\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269719\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : matrix67 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528\u6237\u7684\u6bcf\u4e2a\u8bf7\u6c42\u5f53\u4e00\u4e2a\u4efb\u52a1\uff0c\u4e22\u5230\u961f\u5217\u91cc\u9762\u53bb\uff0c\u7136\u540e go \u5f00 worker \u53bb\u89e3\u51b3\u4efb\u52a1\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269720\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bushenx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @matrix67 \u5f53\u65f6\u662f\u60f3\u5230\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u4f46\u662f\u5982\u679c\u7528\u6237\u63a5\u5165\u91cf\u5f88\u591a\uff0c\u961f\u5217\u662f\u4e0d\u662f\u9700\u8981\u4e00\u4e2a\u5168\u5c40\u9501\u53bb\u4fdd\u62a4\uff0c\u8fd9\u6837\u611f\u89c9\u6709\u5931\u6027\u80fd\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269721\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bushenx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u60f3\u80fd\u4e0d\u80fd\u6709\u4ec0\u4e48\u5e76\u53d1\u6a21\u578b\u80fd\u9650\u5236\u6bcf\u4e2a\u7528\u6237\u8d77\u534f\u7a0b\u7684\u6570\u91cf\uff0c\u4f46\u662f\u53c8\u4e0d\u4f1a\u56e0\u4e3a\u540c\u6b65\u800c\u635f\u5931\u592a\u591a\u6027\u80fd\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269722\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rrfeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5343\u4e07\u7ea7 goroutine \u6ca1\u4ec0\u4e48\u95ee\u9898\u3002<br \/>\u5ef6\u65f6\u654f\u611f\u7684\u4e5f\u4e0d\u4f1a\u7528 go \u5427\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269723\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : namaketa <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u5207\u6027\u80fd\u95ee\u9898\u90fd\u8981\u95ee\u95ee\u81ea\u5df1\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u63d0\u914d\u7f6e \/\u52a0\u673a\u5668\u89e3\u51b3\u5462\u3002<br \/>\u534f\u7a0b\u8c03\u5ea6\u5f00\u9500\u5df2\u7ecf\u5f88\u4f4e\u4e86\uff0c\u7279\u522b\u5bf9\u4e8e\u91cd io \u4efb\u52a1\u3002<br \/>\u5efa\u8bae\u8dd1\u8dd1 benchmark \u81ea\u5df1\u770b\u8c03\u5ea6\u8017\u65f6\u5360\u6bd4\uff0c\u518d\u53bb\u5224\u65ad\u8981\u4e0d\u8981\u4f18\u5316\u3002<br \/>golang \u7ba1\u9053\u6027\u80fd\u786e\u5b9e\u6bd4\u8f83\u4e00\u822c\uff0c\u53ef\u4ee5\u591a\u5f00\u51e0\u4e2a\u7ba1\u9053\u3002<br \/>\u5982\u679c\u4f60\u771f\u7684\u6709\u5343\u4e07\u7ea7\u522b \/\u4f4e\u65f6\u5ef6 \/\u91cd\u8ba1\u7b97\u7684\u4efb\u52a1\uff0c\u653e\u8fc7 go \u5427\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269724\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : faker1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1 \u7684\u611f\u89c9\u53ef\u4ee5\uff0c \u5b9e\u5728\u60f3\u505a\u611f\u89c9 \u53ef\u4ee5\u53c2\u8003 go \u81ea\u5df1\u7684\u4efb\u52a1\u8c03\u5ea6\uff0c \u9501\u7684\u7c92\u5ea6\u653e\u7ec6\uff0c \uff08\u5168\u5c40\uff0c\u5c40\u90e8\uff09\u7c7b\u4f3c\u5206 group , \u611f\u89c9\u8fd9\u4e2a\u662f\u8fc7\u5ea6\u641e\u7684\uff0c\u597d\u50cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269725\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ginjedoad <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f7f\u7528\u534f\u7a0b\u6c60\u5c31\u597d\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269726\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ginjedoad <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6bd4\u5982\u8fd9\u4f4d\u540c\u5b66\u5199\u7684\u7a0d\u5fae\u590d\u6742\u4e86\u70b9\u3002\u4f46\u662f\u5bf9\u4e8e\u534f\u7a0b\u7684\u9650\u5236\u6570\u91cf\u7ea7\u9650\u5236\u7684\u540c\u65f6\uff0c\u6574\u4f53\u6027\u80fd\u4e0d\u5347\u53cd\u964d\u3002https:\/\/github.com\/panjf2000\/ants <\/p>\n<p>\u201c\u5355\u673a\u4e0a\u767e\u4e07\u4e0a\u5343\u4e07\u7684\u540c\u6b65\u6279\u91cf\u4efb\u52a1\u5904\u7406\u73b0\u5b9e\u610f\u4e49\u4e0d\u5927\uff0c\u4f46\u662f\u5728\u5f02\u6b65\u6279\u91cf\u4efb\u52a1\u5904\u7406\u65b9\u9762\u6709\u5f88\u5927\u7684\u5e94\u7528\u4ef7\u503c\uff0c\u6240\u4ee5\u6211\u4e2a\u4eba\u89c9\u5f97\uff0cGoroutine Pool \u771f\u6b63\u7684\u4ef7\u503c\u8fd8\u662f\u5728\uff1a<\/p>\n<p>\u9650\u5236\u5e76\u53d1\u7684 goroutine \u6570\u91cf\uff1b<br \/>\u590d\u7528 goroutine\uff0c\u51cf\u8f7b runtime \u8c03\u5ea6\u538b\u529b\uff0c\u63d0\u5347\u7a0b\u5e8f\u6027\u80fd\uff1b<br \/>\u89c4\u907f\u8fc7\u591a\u7684 goroutine \u4fb5\u5360\u7cfb\u7edf\u8d44\u6e90\uff08 CPU&amp;\u5185\u5b58\uff09\u3002\u201d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269727\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sujin190 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5728\u7ebf\u7a0b\u5916\u8bbe\u8ba1\u534f\u7a0b\u672c\u6765\u5c31\u662f\u4e3a\u4e86\u5e72\u8fd9\u4e2a\u7684\u554a\uff0c\u6bcf\u4e2a\u8bf7\u6c42\u4e00\u4e2a\u534f\u7a0b\uff0c\u4f60\u4eec\u5012\u597d\uff0c\u5c45\u7136\u8fd8\u6015\u534f\u7a0b\u521b\u5efa\u592a\u591a\uff0c\u771f\u662f\u670d\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269728\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sujin190 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e4b\u524d\u505a\u9501\u670d\u52a1\u7684\u65f6\u5019\u6d4b\u8bd5\u8fc7\uff0c\u6bcf\u4e2a\u8bf7\u6c42\u4e00\u4e2a\u534f\u7a0b\uff0c\u5341\u4e07\u7ea7 rps \u5e76\u6ca1\u6709\u5565\u95ee\u9898\uff0c\u60f3\u8981\u66f4\u9ad8\u786e\u5b9e\u9700\u8981\u534f\u7a0b\u590d\u7528\uff0c\u4f46\u8fd9\u4e2a\u8fc7\u7a0b\u5fc5\u987b\u662f\u65e0\u9501\u7684\uff0c\u65e0\u9501\u534f\u7a0b\u6c60\u5e76\u4e0d\u662f\u6bcf\u4e2a\u573a\u666f\u90fd\u80fd\u6709\u7684\uff0cweb \u8fd9\u79cd\u771f\u6ca1\u5565\u5fc5\u8981                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269729\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : bushenx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6216\u8bb8\u662f\u6211\u7684\u8868\u8ff0\u4e0d\u591f\u660e\u786e\uff0c\u4e1a\u52a1\u80cc\u666f\u662f\u670d\u52a1\u4f1a\u5904\u7406\u6240\u6709\u7528\u6237\u7684\u8bf7\u6c42\uff0c\u5047\u8bbe\u67d0\u4e2a\u7528\u6237\u5728\u67d0\u65f6\u95f4\u6bb5\u8bf7\u6c42\u6570\u91cf\u5267\u589e\uff0c\u8fd9\u5c31\u5bfc\u81f4\u4f1a\u521b\u5efa\u5f88\u591a\u534f\u7a0b\uff0c\u800c\u5f88\u591a\u7684\u534f\u7a0b\u4f1a\u5f71\u54cd\u5176\u4ed6\u7528\u6237\u521b\u5efa\u7684\u534f\u7a0b\u3002\u6211\u662f\u60f3\u51cf\u8f7b\u5355\u4e2a\u7528\u6237\u5bf9\u6240\u6709\u7528\u6237\u7684\u5f71\u54cd\uff0c\u6240\u4ee5\u9650\u5236\u534f\u7a0b\u6570\u91cf\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269730\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : scnace <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u81ea\u5df1\u505a\u4e2a benchmark \u5c31\u77e5\u9053\u4e86\u554a\uff0c \u53cd\u6b63\u4e0a\u7684\u4eba\u8bf4\u4e86\u4f60\u4e5f\u4e0d\u6562\u76f4\u63a5\u5c31\u8fd9\u4e48\u5e72\u5427\u3002\u3002\u5b9e\u5728\u4e0d\u884c\u5c31\u4e0a goroutine pool \u5457\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5269731\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6b6a\u4e2a\u95ee\u4e00\u53e5\uff0c\u8981\u770b\u61c2\u4e0a\u5927\u4f6c\u4eec\u6240\u8ba8\u8bba\u7684\u4e1c\u897f\uff0c\u5927\u6982\u8981\u51e0\u5e74\u7684\u5de5\u4f5c \/golang \u7ecf\u9a8c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Go \u7684\u5e76\u53d1\u6a21\u578b\u7684\u4e00\u4e9b\u95ee\u9898 \u8cc7\u6df1\u5927&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/341175"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=341175"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/341175\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=341175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=341175"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=341175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}