{"id":4721,"date":"2021-12-07T22:00:39","date_gmt":"2021-12-08T06:00:39","guid":{"rendered":"https:\/\/www.xh86.me\/?p=4721"},"modified":"2021-12-07T22:11:44","modified_gmt":"2021-12-08T06:11:44","slug":"%e8%ae%b0%e4%b8%80%e6%ac%a1%e6%8f%90%e5%8d%8718%e5%80%8d%e7%9a%84%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=4721","title":{"rendered":"\u8bb0\u4e00\u6b21\u63d0\u534718\u500d\u7684\u6027\u80fd\u4f18\u5316"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"font-size: 16px;\" data-mpa-powered-by=\"yiban.io\">\n<section style=\"color: black; line-height: 1.6; letter-spacing: 0px; word-break: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; font-size: 14px; padding: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\">\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; background-color: #000; color: #fff; padding: 2px 10px; width: fit-content; font-size: 17px; margin: 60px auto 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u80cc\u666f<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6700\u8fd1\u8d1f\u8d23\u7684\u4e00\u4e2a\u81ea\u7814\u7684 Dubbo \u6ce8\u518c\u4e2d\u5fc3\u7ecf\u5e38\u6536\u5230 CPU \u4f7f\u7528\u7387\u7684\u544a\u8b66\uff0c\u4e8e\u662f\u8fdb\u884c\u4e86\u4e00\u6ce2\u4f18\u5316\uff0c\u6548\u679c\u8fd8\u4e0d\u9519\uff0c\u4e8e\u662f\u6253\u7b97\u5206\u4eab\u4e0b\u601d\u8003\u3001\u4f18\u5316\u8fc7\u7a0b\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u4e00\u4e9b\u5e2e\u52a9\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u81ea\u7814 Dubbo \u6ce8\u518c\u4e2d\u5fc3\u662f\u4e2a\u4ec0\u4e48\u4e1c\u897f\uff0c\u6211\u753b\u4e2a\u7b80\u56fe\u5927\u5bb6\u7a0d\u5fae\u611f\u53d7\u4e00\u4e0b\u5c31\u597d\uff0c\u770b\u4e0d\u61c2\u4e5f\u6ca1\u5173\u7cfb\uff0c\u4e0d\u5f71\u54cd\u540e\u7eed\u7684\u7406\u89e3\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-1024cdc48dd5e6764e835330f8924595.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; height: auto !important;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-1024cdc48dd5e6764e835330f8924595.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.7168674698795181\" data-type=\"png\" data-w=\"996\" \/><\/div><\/figure>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: square;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">Consumer \u548c Provider \u7684\u670d\u52a1\u53d1\u73b0\u8bf7\u6c42\uff08\u6ce8\u518c\u3001\u6ce8\u9500\u3001\u8ba2\u9605\uff09\u90fd\u53d1\u7ed9 Agent\uff0c\u7531\u5b83\u5168\u6743\u4ee3\u7406<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">Registry \u548c Agent \u4fdd\u6301 Grpc \u957f\u94fe\u63a5\uff0c\u957f\u94fe\u63a5\u7684\u76ee\u7684\u4e3b\u8981\u662f Provider \u65b9\u6709\u53d8\u66f4\u65f6\uff0c\u80fd\u53ca\u65f6\u63a8\u9001\u7ed9\u76f8\u5e94\u7684 Consumer\u3002\u4e3a\u4e86\u4fdd\u8bc1\u6570\u636e\u7684\u6b63\u786e\u6027\uff0c\u505a\u4e86\u63a8\u62c9\u7ed3\u5408\u7684\u673a\u5236\uff0cAgent \u4f1a\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u53bb Registry \u62c9\u53d6\u8ba2\u9605\u7684\u670d\u52a1\u5217\u8868<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">Agent \u548c\u4e1a\u52a1\u670d\u52a1\u90e8\u7f72\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\uff0c\u7c7b\u4f3c Service Mesh \u7684\u601d\u8def\uff0c\u5c3d\u91cf\u51cf\u5c11\u5bf9\u4e1a\u52a1\u7684\u5165\u4fb5\uff0c\u8fd9\u6837\u5c31\u80fd\u5feb\u901f\u7684\u8fed\u4ee3\u4e86<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u56de\u5230\u4eca\u5929\u7684\u91cd\u70b9\uff0c\u8fd9\u4e2a\u6ce8\u518c\u4e2d\u5fc3\u6700\u8fd1 CPU \u4f7f\u7528\u7387\u957f\u671f\u5904\u4e8e\u4e2d\u9ad8\u6c34\u4f4d\uff0c\u5076\u5c14\u6709\u5e94\u7528\u53d1\u5e03\uff0c\u63a8\u9001\u91cf\u5927\u65f6\uff0cCPU \u751a\u81f3\u4f1a\u88ab\u6253\u6ee1\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ee5\u524d\u6ca1\u611f\u89c9\u5230\uff0c\u662f\u56e0\u4e3a\u63a5\u5165\u7684\u5e94\u7528\u4e0d\u591a\uff0c\u6700\u8fd1\u51e0\u4e2a\u6708\u5e94\u7528\u8d8a\u63a5\u8d8a\u591a\uff0c\u6162\u6162\u5c31\u8fbe\u5230\u4e86\u544a\u8b66\u9608\u503c\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; background-color: #000; color: #fff; padding: 2px 10px; width: fit-content; font-size: 17px; margin: 60px auto 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5bfb\u627e\u4f18\u5316\u70b9<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7531\u4e8e\u8fd9\u9879\u76ee\u662f Go \u5199\u7684\uff08\u4e0d\u61c2 Go \u7684\u670b\u53cb\u4e5f\u6ca1\u5173\u7cfb\uff0c\u672c\u6587\u91cd\u70b9\u5728\u7b97\u6cd5\u7684\u4f18\u5316\uff0c\u4e0d\u5728\u5de5\u5177\u7684\u4f7f\u7528\u4e0a\uff09\uff0c \u627e\u5230\u54ea\u91cc\u8017 CPU \u8fd8\u662f\u633a\u7b80\u5355\u7684\uff1a\u6253\u5f00 pprof \u5373\u53ef\uff0c\u53bb\u7ebf\u4e0a\u91c7\u96c6\u4e00\u6bb5\u65f6\u95f4\u5373\u53ef\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5177\u4f53\u600e\u4e48\u64cd\u4f5c\u53ef\u4ee5\u53c2\u8003\u6211\u4e4b\u524d\u7684\uff0c\u4eca\u5929\u6587\u7ae0\u4e2d\u7528\u5230\u7684\u77e5\u8bc6\u548c\u5de5\u5177\uff0c\u8fd9\u7bc7\u6587\u7ae0\u90fd\u80fd\u627e\u5230\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-d29183a17280ca79ed38db9e3ad27f68.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; height: auto !important;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-d29183a17280ca79ed38db9e3ad27f68.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.32934553131597466\" data-type=\"png\" data-w=\"2842\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">CPU profile \u622a\u4e86\u90e8\u5206\u56fe\uff0c\u5176\u4ed6\u7684\u4e0d\u592a\u91cd\u8981\uff0c\u53ef\u4ee5\u770b\u5230\u6d88\u8017 CPU \u591a\u7684\u662f <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">AssembleCategoryProviders<\/code>\u65b9\u6cd5\uff0c\u4e0e\u5176\u76f4\u63a5\u5173\u8054\u7684\u662f<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: square;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">2\u4e2a redis \u76f8\u5173\u7684\u65b9\u6cd5<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">1\u4e2a\u53eb<code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">assembleUrlWeight<\/code>\u7684\u65b9\u6cd5<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7a0d\u5fae\u89e3\u91ca\u4e0b\uff0cAssembleCategoryProviders \u65b9\u6cd5\u662f\u6784\u9020\u8fd4\u56de Dubbo provider \u7684 url\uff0c\u7531\u4e8e\u4f1a\u5728\u8fd4\u56de url \u65f6\u5bf9\u5176\u505a\u4e00\u4e9b\u5904\u7406\uff08\u6bd4\u5982\u8c03\u6574\u6743\u91cd\u7b49\uff09\uff0c\u4f1a\u6d89\u53ca\u5230\u5bf9\u8fd9\u4e2a Dubbo url \u7684\u89e3\u6790\u3002\u53c8\u7531\u4e8e\u63a8\u62c9\u7ed3\u5408\u7684\u6a21\u5f0f\uff0c\u7ebf\u4e0a\u670d\u52a1\u4f7f\u7528\u65b9\u8d8a\u591a\uff0c\u8fd9\u4e2a\u5904\u7406\u7684 QPS \u5c31\u8d8a\u5927\uff0c\u6240\u4ee5\u5b83\u5360\u7528\u4e86\u5927\u90e8\u5206 CPU \u4e00\u70b9\u4e5f\u4e0d\u5947\u602a\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u4e24\u4e2a redis \u64cd\u4f5c\u53ef\u80fd\u662f\u5e8f\u5217\u5316\u5360\u7528\u4e86 CPU\uff0c\u66f4\u5927\u5934\u5728 assembleUrlWeight\uff0c\u6709\u70b9\u7422\u78e8\u4e0d\u900f\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u5206\u6790\u4e0b assembleUrlWeight \u5982\u4f55\u4f18\u5316\uff0c\u56e0\u4e3a\u4ed6\u5360\u7528 CPU \u6700\u591a\uff0c\u4f18\u5316\u6548\u679c\u80af\u5b9a\u6700\u597d\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e0b\u9762\u662f assembleUrlWeight \u7684\u4f2a\u4ee3\u7801\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">AssembleUrlWeight<\/span><span style=\"line-height: 26px;\">(rawurl\u00a0<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>,\u00a0lidcWeight\u00a0<span style=\"color: #c678dd; line-height: 26px;\">int<\/span>)<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">string<\/span><\/span>\u00a0{\r\n\u00a0u,\u00a0err\u00a0:=\u00a0url.Parse(rawurl)\r\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{\r\n\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0rawurl\r\n\u00a0}<\/code><\/pre>\n<p>values,\u00a0err\u00a0:=\u00a0url.ParseQuery(u.RawQuery)<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0rawurl<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p><span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0values.Get(<span style=\"color: #98c379; line-height: 26px;\">&#8220;lidc_weight&#8221;<\/span>)\u00a0!=\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;&#8221;<\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0rawurl<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p>endpointWeight\u00a0:=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">100<\/span><br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0values.Get(<span style=\"color: #98c379; line-height: 26px;\">&#8220;weight&#8221;<\/span>)\u00a0!=\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;&#8221;<\/span>\u00a0{<br \/>\nendpointWeight,\u00a0err\u00a0=\u00a0strconv.Atoi(values.Get(<span style=\"color: #98c379; line-height: 26px;\">&#8220;weight&#8221;<\/span>))<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{<br \/>\nendpointWeight\u00a0=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">100<\/span><br \/>\n}<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p>values.Set(<span style=\"color: #98c379; line-height: 26px;\">&#8220;weight&#8221;<\/span>,\u00a0strconv.Itoa(lidcWeight*endpointWeight))<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p>u.RawQuery\u00a0=\u00a0values.Encode()<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0u.String()<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f20\u53c2 rawurl \u662f Dubbo provider \u7684url\uff0clidcWeight \u662f\u673a\u623f\u6743\u91cd\u3002\u6839\u636e\u914d\u7f6e\u7684\u673a\u623f\u6743\u91cd\uff0c\u5c06 url \u4e2d\u7684 weight \u8fdb\u884c\u91cd\u65b0\u8ba1\u7b97\uff0c\u5b9e\u73b0\u591a\u673a\u623f\u6d41\u91cf\u6309\u6743\u91cd\u7684\u5206\u914d\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u4e2a\u8fc7\u7a0b\u6d89\u53ca\u5230 url \u53c2\u6570\u7684\u89e3\u6790\uff0c\u518d\u8fdb\u884c weight \u7684\u8ba1\u7b97\uff0c\u6700\u540e\u518d\u8fd8\u539f\u4e3a\u4e00\u4e2a url<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Dubbo \u7684 url \u7ed3\u6784\u548c\u666e\u901a url \u7ed3\u6784\u4e00\u81f4\uff0c\u5176\u7279\u70b9\u662f\u53c2\u6570\u53ef\u80fd\u6bd4\u8f83\u591a\uff0c\u6ca1\u6709 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">#<\/code>\u540e\u9762\u7684\u7247\u6bb5\u90e8\u5206\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-9d033b8327dd43588606181548b8dc81.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; height: auto !important;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-9d033b8327dd43588606181548b8dc81.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.3757183908045977\" data-type=\"png\" data-w=\"2784\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">CPU \u4e3b\u8981\u5c31\u6d88\u8017\u5728\u8fd9\u4e24\u6b21\u89e3\u6790\u548c\u6700\u540e\u7684\u8fd8\u539f\u4e2d\uff0c\u6211\u4eec\u770b\u8fd9\u4e24\u6b21\u89e3\u6790\u7684\u76ee\u7684\u5c31\u662f\u4e3a\u4e86\u62ff\u5230 url \u4e2d\u7684 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">lidc_weight<\/code> \u548c <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">weight<\/code> \u53c2\u6570\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">url.Parse \u548c url.ParseQuery \u90fd\u662f Go \u5b98\u65b9\u63d0\u4f9b\u7684\u5e93\uff0c\u5404\u4e2a\u8bed\u8a00\u4e5f\u90fd\u6709\u5b9e\u73b0\uff0c\u5176\u6838\u5fc3\u662f\u89e3\u6790 url \u4e3a\u4e00\u4e2a\u5bf9\u8c61\uff0c\u65b9\u4fbf\u5730\u83b7\u53d6 url \u7684\u5404\u4e2a\u90e8\u5206\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c\u4e86\u89e3\u4fe1\u606f\u71b5\u8fd9\u4e2a\u6982\u5ff5\uff0c\u5176\u5b9e\u4f60\u5c31\u5927\u6982\u77e5\u9053\u8fd9\u91cc\u9762\u4e00\u5b9a\u662f\u53ef\u4ee5\u4f18\u5316\u7684\u3002<code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">Shannon\uff08\u9999\u519c\uff09<\/code> \u501f\u9274\u4e86\u70ed\u529b\u5b66\u7684\u6982\u5ff5\uff0c\u628a\u4fe1\u606f\u4e2d\u6392\u9664\u4e86\u5197\u4f59\u540e\u7684\u5e73\u5747\u4fe1\u606f\u91cf\u79f0\u4e3a<code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">\u4fe1\u606f\u71b5<\/code>\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-5f74dc303263a18e1013d4e289626ef5.jpeg'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; height: auto !important;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-5f74dc303263a18e1013d4e289626ef5.jpeg\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.7171875\" data-type=\"jpeg\" data-w=\"640\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">url.Parse \u548c url.ParseQuery \u5728\u8fd9\u4e2a\u573a\u666f\u4e0b\u89e3\u6790\u80af\u5b9a\u5b58\u5728\u5197\u4f59\uff0c\u5197\u4f59\u610f\u5473\u7740 CPU \u5728\u505a\u591a\u4f59\u7684\u4e8b\u60c5\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u56e0\u4e3a\u4e00\u4e2a Dubbo url \u53c2\u6570\u901a\u5e38\u662f\u5f88\u591a\u7684\uff0c\u6211\u4eec\u53ea\u9700\u8981\u62ff\u8fd9\u4e24\u4e2a\u53c2\u6570\uff0c\u800c url.Parse \u89e3\u6790\u4e86\u6240\u6709\u7684\u53c2\u6570\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u7ed9\u5b9a\u4e00\u4e2a\u6570\u7ec4\uff0c\u6c42\u5176\u4e2d\u7684\u6700\u5927\u503c\uff0c\u5982\u679c\u5148\u5bf9\u6570\u7ec4\u8fdb\u884c\u6392\u5e8f\uff0c\u518d\u53d6\u6700\u5927\u503c\u663e\u7136\u662f\u5b58\u5728\u5197\u4f59\u64cd\u4f5c\u7684\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6392\u5e8f\u540e\u7684\u6570\u7ec4\u4e0d\u4ec5\u80fd\u53d6\u6700\u5927\u503c\uff0c\u8fd8\u80fd\u53d6\u7b2c\u4e8c\u5927\u503c\u3001\u7b2c\u4e09\u5927\u503c&#8230;\u6700\u5c0f\u503c\uff0c\u4fe1\u606f\u5b58\u5728\u5197\u4f59\u4e86\uff0c\u6240\u4ee5\u5148\u6392\u5e8f\u80af\u5b9a\u4e0d\u662f\u6c42\u6700\u5927\u503c\u7684\u6700\u4f18\u89e3\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; background-color: #000; color: #fff; padding: 2px 10px; width: fit-content; font-size: 17px; margin: 60px auto 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f18\u5316<\/h3>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f18\u5316\u83b7\u53d6 url \u53c2\u6570\u6027\u80fd<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7b2c\u4e00\u60f3\u6cd5\u662f\uff0c\u4e0d\u8981\u89e3\u6790\u5168\u90e8 url\uff0c\u53ea\u62ff\u76f8\u5e94\u7684\u53c2\u6570\uff0c\u8fd9\u5c31\u5f88\u50cf\u6211\u4eec\u5199\u7684\u7b97\u6cd5\u9898\uff0c\u6bd4\u5982\u83b7\u53d6 weight \u53c2\u6570\uff0c\u5b83\u53ea\u53ef\u80fd\u662f\u8fd9\u4e24\u79cd\u60c5\u51b5\uff08\u4e0d\u5b58\u5728 #\uff0c\u6240\u4ee5\u7b80\u5355\u5f88\u591a\uff09\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: square;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">dubbo:\/\/127.0.0.1:20880\/org.newboo.basic.MyDemoService?weight=100&amp;&#8230;<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">dubbo:\/\/127.0.0.1:20880\/org.newboo.basic.MyDemoService?xx=yy&amp;weight=100&amp;&#8230;<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8981\u4e48\u662f <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">&amp;weight=<\/code>\uff0c\u8981\u4e48\u662f <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">?weight=<\/code>\uff0c\u7ed3\u675f\u8981\u4e48\u662f<code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">&amp;<\/code>\uff0c\u8981\u4e48\u76f4\u63a5\u5230\u5b57\u7b26\u4e32\u5c3e\uff0c\u4ee3\u7801\u5c31\u5f88\u597d\u5199\u4e86\uff0c\u5148\u624b\u5199\u4e2a\u89e3\u6790\u53c2\u6570\u7684\u7b97\u6cd5\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">GetUrlQueryParam<\/span><span style=\"line-height: 26px;\">(u\u00a0<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>,\u00a0key\u00a0<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>)<\/span>\u00a0<span style=\"line-height: 26px;\">(<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>,\u00a0error)<\/span><\/span>\u00a0{\r\n\u00a0sb\u00a0:=\u00a0strings.Builder{}\r\n\u00a0sb.WriteString(key)\r\n\u00a0sb.WriteString(<span style=\"color: #98c379; line-height: 26px;\">\"=\"<\/span>)\r\n\u00a0index\u00a0:=\u00a0strings.Index(u,\u00a0sb.String())\r\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0(index\u00a0==\u00a0<span style=\"color: #d19a66; line-height: 26px;\">-1<\/span>)\u00a0||\u00a0(index+<span style=\"color: #e6c07b; line-height: 26px;\">len<\/span>(key)+<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>\u00a0&gt;\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">len<\/span>(u))\u00a0{\r\n\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"\"<\/span>,\u00a0UrlParamNotExist\r\n\u00a0}<\/code><\/pre>\n<p><span style=\"color: #c678dd; line-height: 26px;\">var<\/span>\u00a0value\u00a0=\u00a0strings.Builder{}<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0i\u00a0:=\u00a0index\u00a0+\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">len<\/span>(key)\u00a0+\u00a0<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>;\u00a0i\u00a0&lt;\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">len<\/span>(u);\u00a0i++\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0i+<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>\u00a0&gt;\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">len<\/span>(u)\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">break<\/span><br \/>\n}<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0u[i:i+<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>]\u00a0==\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;&amp;&#8221;<\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">break<\/span><br \/>\n}<br \/>\nvalue.WriteString(u[i\u00a0:\u00a0i+<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>])<br \/>\n}<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0value.String(),\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span><br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u539f\u5148\u83b7\u53d6\u53c2\u6570\u7684\u65b9\u6cd5\u53ef\u4ee5\u6458\u51fa\u6765\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">getParamByUrlParse<\/span><span style=\"line-height: 26px;\">(ur\u00a0<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>,\u00a0key\u00a0<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>)<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">string<\/span><\/span>\u00a0{\r\n\u00a0u,\u00a0err\u00a0:=\u00a0url.Parse(ur)\r\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{\r\n\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"\"<\/span>\r\n\u00a0}<\/code><\/pre>\n<p>values,\u00a0err\u00a0:=\u00a0url.ParseQuery(u.RawQuery)<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;&#8221;<\/span><br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p><span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0values.Get(key)<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5148\u5bf9\u8fd9\u4e24\u4e2a\u51fd\u6570\u8fdb\u884c benchmark\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">BenchmarkGetQueryParam<\/span><span style=\"line-height: 26px;\">(b\u00a0*testing.B)<\/span><\/span>\u00a0{\r\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0i\u00a0:=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>;\u00a0i\u00a0&lt;\u00a0b.N;\u00a0i++\u00a0{\r\n\u00a0\u00a0getParamByUrlParse(u,\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"anyhost\"<\/span>)\r\n\u00a0\u00a0getParamByUrlParse(u,\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"version\"<\/span>)\r\n\u00a0\u00a0getParamByUrlParse(u,\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"not_exist\"<\/span>)\r\n\u00a0}\r\n}<\/code><\/pre>\n<p><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">BenchmarkGetQueryParamNew<\/span><span style=\"line-height: 26px;\">(b\u00a0*testing.B)<\/span><\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0i\u00a0:=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>;\u00a0i\u00a0&lt;\u00a0b.N;\u00a0i++\u00a0{<br \/>\nGetUrlQueryParam(u,\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;anyhost&#8221;<\/span>)<br \/>\nGetUrlQueryParam(u,\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;version&#8221;<\/span>)<br \/>\nGetUrlQueryParam(u,\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;not_exist&#8221;<\/span>)<br \/>\n}<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">Benchmark \u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">BenchmarkGetQueryParam-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0103412\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09708\u00a0ns\/op\r\nBenchmarkGetQueryParam-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0111794\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09685\u00a0ns\/op\r\nBenchmarkGetQueryParam-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0115699\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a09818\u00a0ns\/op\r\nBenchmarkGetQueryParamNew-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02961254\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0409\u00a0ns\/op\r\nBenchmarkGetQueryParamNew-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02944274\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0406\u00a0ns\/op\r\nBenchmarkGetQueryParamNew-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02895690\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0405\u00a0ns\/op\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u53ef\u4ee5\u770b\u5230\u6027\u80fd\u5927\u6982\u63d0\u5347\u4e8620\u591a\u500d<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u65b0\u5199\u7684\u8fd9\u4e2a\u65b9\u6cd5\uff0c\u6709\u4e24\u4e2a\u5c0f\u7ec6\u8282\uff0c\u7b2c\u4e00\u662f\u8fd4\u56de\u503c\u4e2d\u533a\u5206\u4e86\u53c2\u6570\u662f\u5426\u5b58\u5728\uff0c\u8fd9\u4e2a\u540e\u9762\u4f1a\u7528\u5230\uff1b\u7b2c\u4e8c\u662f\u5b57\u7b26\u4e32\u7684\u64cd\u4f5c\u7528\u5230\u4e86 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">strings.Builder<\/code>\uff0c\u8fd9\u4e5f\u662f\u5b9e\u9645\u6d4b\u8bd5\u7684\u7ed3\u679c\uff0c\u4f7f\u7528 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">+<\/code>\u6216\u8005 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">fmt.Springf<\/code> \u6027\u80fd\u90fd\u6ca1\u8fd9\u4e2a\u597d\uff0c\u611f\u5174\u8da3\u53ef\u4ee5\u6d4b\u8bd5\u4e0b\u770b\u770b\u3002<\/p>\n<h4 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; font-size: 18px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f18\u5316 url \u5199\u5165\u53c2\u6570\u6027\u80fd<\/h4>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8ba1\u7b97\u51fa weight \u540e\u518d\u628a weight \u5199\u5165 url \u4e2d\uff0c\u8fd9\u91cc\u76f4\u63a5\u7ed9\u51fa\u4f18\u5316\u540e\u7684\u4ee3\u7801\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">AssembleUrlWeightNew<\/span><span style=\"line-height: 26px;\">(rawurl\u00a0<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>,\u00a0lidcWeight\u00a0<span style=\"color: #c678dd; line-height: 26px;\">int<\/span>)<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">string<\/span><\/span>\u00a0{\r\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0lidcWeight\u00a0==\u00a0<span style=\"color: #d19a66; line-height: 26px;\">1<\/span>\u00a0{\r\n\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0rawurl\r\n\u00a0}<\/code><\/pre>\n<p>lidcWeightStr,\u00a0err1\u00a0:=\u00a0GetUrlQueryParam(rawurl,\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;lidc_weight&#8221;<\/span>)<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err1\u00a0==\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0&amp;&amp;\u00a0lidcWeightStr\u00a0!=\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;&#8221;<\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0rawurl<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p><span style=\"color: #c678dd; line-height: 26px;\">var<\/span>\u00a0err\u00a0error<br \/>\nendpointWeight\u00a0:=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">100<\/span><br \/>\nweightStr,\u00a0err2\u00a0:=\u00a0GetUrlQueryParam(rawurl,\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;weight&#8221;<\/span>)<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0weightStr\u00a0!=\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;&#8221;<\/span>\u00a0{<br \/>\nendpointWeight,\u00a0err\u00a0=\u00a0strconv.Atoi(weightStr)<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{<br \/>\nendpointWeight\u00a0=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">100<\/span><br \/>\n}<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p><span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0err2\u00a0!=\u00a0<span style=\"color: #56b6c2; line-height: 26px;\">nil<\/span>\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0url\u4e2d\u4e0d\u5b58\u5728weight<\/span><br \/>\nfinUrl\u00a0:=\u00a0strings.Builder{}<br \/>\nfinUrl.WriteString(rawurl)<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0strings.Contains(rawurl,\u00a0<span style=\"color: #98c379; line-height: 26px;\">&#8220;?&#8221;<\/span>)\u00a0{<br \/>\nfinUrl.WriteString(<span style=\"color: #98c379; line-height: 26px;\">&#8220;&amp;weight=&#8221;<\/span>)<br \/>\nfinUrl.WriteString(strconv.Itoa(lidcWeight\u00a0*\u00a0endpointWeight))<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0finUrl.String()<br \/>\n}\u00a0<span style=\"color: #c678dd; line-height: 26px;\">else<\/span>\u00a0{<br \/>\nfinUrl.WriteString(<span style=\"color: #98c379; line-height: 26px;\">&#8220;?weight=&#8221;<\/span>)<br \/>\nfinUrl.WriteString(strconv.Itoa(lidcWeight\u00a0*\u00a0endpointWeight))<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0finUrl.String()<br \/>\n}<br \/>\n}\u00a0<span style=\"color: #c678dd; line-height: 26px;\">else<\/span>\u00a0{\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0url\u4e2d\u5b58\u5728weight<\/span><br \/>\noldWeightStr\u00a0:=\u00a0strings.Builder{}<br \/>\noldWeightStr.WriteString(<span style=\"color: #98c379; line-height: 26px;\">&#8220;weight=&#8221;<\/span>)<br \/>\noldWeightStr.WriteString(weightStr)<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p>newWeightStr\u00a0:=\u00a0strings.Builder{}<br \/>\nnewWeightStr.WriteString(<span style=\"color: #98c379; line-height: 26px;\">&#8220;weight=&#8221;<\/span>)<br \/>\nnewWeightStr.WriteString(strconv.Itoa(lidcWeight\u00a0*\u00a0endpointWeight))<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0strings.ReplaceAll(rawurl,\u00a0oldWeightStr.String(),\u00a0newWeightStr.String())<br \/>\n}<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e3b\u8981\u5c31\u662f\u5206\u4e3a url \u4e2d\u662f\u5426\u5b58\u5728 weight \u4e24\u79cd\u60c5\u51b5\u6765\u8ba8\u8bba\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: square;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">url \u672c\u8eab\u4e0d\u5b58\u5728 weight \u53c2\u6570\uff0c\u5219\u76f4\u63a5\u5728 url \u540e\u62fc\u63a5\u4e00\u4e2a weight \u53c2\u6570\uff0c\u5f53\u7136\u8981\u6ce8\u610f\u662f\u5426\u5b58\u5728 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">?<\/code><\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">url \u672c\u8eab\u5b58\u5728 weight \u53c2\u6570\uff0c\u5219\u76f4\u63a5\u8fdb\u884c\u5b57\u7b26\u4e32\u66ff\u6362<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7ec6\u5fc3\u7684\u4f60\u80af\u5b9a\u53c8\u53d1\u73b0\u4e86\uff0c\u5f53 <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">lidcWeight = 1<\/code> \u65f6\uff0c\u76f4\u63a5\u8fd4\u56de\uff0c\u56e0\u4e3a <code style=\"padding: 2px 4px; border-radius: 4px; margin-right: 2px; margin-left: 2px; background-color: rgba(27, 31, 35, 0.05); font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #ff6441;\">lidcWeight = 1<\/code> \u65f6\uff0c\u540e\u9762\u7684\u8ba1\u7b97\u5176\u5b9e\u90fd\u4e0d\u8d77\u4f5c\u7528\uff08Dubbo \u6743\u91cd\u9ed8\u8ba4\u4e3a100\uff09\uff0c\u7d22\u6027\u522b\u64cd\u4f5c\uff0c\u7701\u70b9 CPU\u3002<\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5168\u90e8\u4f18\u5316\u5b8c\uff0c\u603b\u4f53\u505a\u4e00\u4e0b benchmark\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">BenchmarkAssembleUrlWeight<\/span><span style=\"line-height: 26px;\">(b\u00a0*testing.B)<\/span><\/span>\u00a0{\r\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0i\u00a0:=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>;\u00a0i\u00a0&lt;\u00a0b.N;\u00a0i++\u00a0{\r\n\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0_,\u00a0ut\u00a0:=\u00a0<span style=\"color: #c678dd; line-height: 26px;\">range<\/span>\u00a0[]<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>{u,\u00a0u1,\u00a0u2,\u00a0u3}\u00a0{\r\n\u00a0\u00a0\u00a0AssembleUrlWeight(ut,\u00a0<span style=\"color: #d19a66; line-height: 26px;\">60<\/span>)\r\n\u00a0\u00a0}\r\n\u00a0}\r\n}<\/code><\/pre>\n<p><span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">func<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">BenchmarkAssembleUrlWeightNew<\/span><span style=\"line-height: 26px;\">(b\u00a0*testing.B)<\/span><\/span>\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0i\u00a0:=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>;\u00a0i\u00a0&lt;\u00a0b.N;\u00a0i++\u00a0{<br \/>\n<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0_,\u00a0ut\u00a0:=\u00a0<span style=\"color: #c678dd; line-height: 26px;\">range<\/span>\u00a0[]<span style=\"color: #c678dd; line-height: 26px;\">string<\/span>{u,\u00a0u1,\u00a0u2,\u00a0u3}\u00a0{<br \/>\nAssembleUrlWeightNew(ut,\u00a0<span style=\"color: #d19a66; line-height: 26px;\">60<\/span>)<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre style=\"box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; margin-right: auto; margin-left: auto;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\">BenchmarkAssembleUrlWeight-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a034275\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a033289\u00a0ns\/op\r\nBenchmarkAssembleUrlWeight-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a036646\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a032432\u00a0ns\/op\r\nBenchmarkAssembleUrlWeight-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a036702\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a032740\u00a0ns\/op\r\nBenchmarkAssembleUrlWeightNew-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0573684\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01851\u00a0ns\/op\r\nBenchmarkAssembleUrlWeightNew-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0646952\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01832\u00a0ns\/op\r\nBenchmarkAssembleUrlWeightNew-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0563392\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a01896\u00a0ns\/op\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5927\u6982\u63d0\u5347 18 \u500d\u6027\u80fd\uff0c\u800c\u4e14\u8fd9\u53ef\u80fd\u8fd8\u662f\u6bd4\u8f83\u5dee\u7684\u60c5\u51b5\uff0c\u5982\u679c\u4f20\u5165 lidcWeight = 1\uff0c\u6548\u679c\u66f4\u597d\u3002<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; background-color: #000; color: #fff; padding: 2px 10px; width: fit-content; font-size: 17px; margin: 60px auto 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6548\u679c<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f18\u5316\u5b8c\uff0c\u5bf9\u6539\u52a8\u65b9\u6cd5\u5199\u4e86\u76f8\u5e94\u7684\u5355\u5143\u6d4b\u8bd5\uff0c\u786e\u8ba4\u6ca1\u95ee\u9898\u540e\uff0c\u4e0a\u7ebf\u8fdb\u884c\u89c2\u5bdf\uff0cCPU Idle\uff08\u7a7a\u95f2\u7387\uff09 \u63d0\u5347\u4e8610%\u4ee5\u4e0a<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/figure>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; font-weight: bold; background-color: #000; color: #fff; padding: 2px 10px; width: fit-content; font-size: 17px; margin: 60px auto 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6700\u540e<\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5176\u5b9e\u672c\u6587\u5c55\u793a\u7684\u662f\u4e00\u4e2a Go \u7a0b\u5e8f\u975e\u5e38\u5e38\u89c4\u7684\u6027\u80fd\u4f18\u5316\uff0c\u4e5f\u662f\u76f8\u5bf9\u6765\u8bf4\u6bd4\u8f83\u7b80\u5355\uff0c\u770b\u5b8c\u540e\uff0c\u5927\u5bb6\u53ef\u80fd\u8fd8\u6709\u7591\u95ee\uff1a<\/p>\n<ul class=\"list-paddingleft-2\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; list-style-type: square;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3a\u4ec0\u4e48\u8981\u5728\u63a8\u9001\u548c\u62c9\u53d6\u7684\u65f6\u5019\u53bb\u89e3\u6790 url \u5462\uff1f\u4e0d\u80fd\u4e8b\u5148\u7b97\u597d\u5b58\u8d77\u6765\u5417\uff1f<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; color: #010101;\">\u4e3a\u4ec0\u4e48\u53ea\u4f18\u5316\u4e86\u8fd9\u70b9\uff0c\u5176\u4ed6\u7684\u70b9\u662f\u5426\u4e5f\u53ef\u4ee5\u4f18\u5316\u5462\uff1f<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9488\u5bf9\u7b2c\u4e00\u4e2a\u95ee\u9898\uff0c\u5176\u5b9e\u8fd9\u662f\u4e2a\u5386\u53f2\u95ee\u9898\uff0c\u5f53\u4f60\u63a5\u624b\u7cfb\u7edf\u65f6\u4ed6\u5c31\u662f\u8fd9\u6837\uff0c\u5982\u679c\u7a0b\u5e8f\u51fa\u95ee\u9898\uff0c\u4f60\u53bb\u6539\u6574\u4e2a\u673a\u5236\uff0c\u53ef\u80fd\u5468\u671f\u6bd4\u8f83\u957f\uff0c\u800c\u4e14\u5bb9\u6613\u51fa\u95ee\u9898<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-697f705c99b244a0f82ade19750a5ff3.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px; border-radius: 4px; margin-top: 10px; height: auto !important;\" data-original=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/12\/wxsync-2021-12-697f705c99b244a0f82ade19750a5ff3.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" data-ratio=\"0.899505766062603\" data-type=\"png\" data-w=\"607\" \/><\/div><\/figure>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7b2c\u4e8c\u4e2a\u95ee\u9898\uff0c\u5176\u5b9e\u521a\u4e5f\u987a\u5e26\u56de\u7b54\u4e86\uff0c\u8fd9\u6837\u4f18\u5316\uff0c\u6539\u52a8\u6700\u5c0f\uff0c\u6536\u76ca\u6700\u5927\uff0c\u522b\u7684\u70b9\u6ca1\u8fd9\u4e48\u597d\u6539\uff0c\u77ed\u671f\u6765\u8bf4\uff0c\u62ff\u6536\u76ca\u6700\u91cd\u8981\u3002\u5f53\u7136\u6211\u4eec\u540e\u7eed\u4e5f\u6253\u7b97\u5bf9\u8fd9\u4e2a\u7cfb\u7edf\u8fdb\u884c\u91cd\u6784\uff0c\u4f46\u91cd\u6784\u4e4b\u524d\uff0c\u8fd9\u6837\u4f18\u5316\uff0c\u8db3\u4ee5\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/section>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u6700\u8fd1\u8d1f\u8d23\u7684\u4e00\u4e2a\u81ea\u7814\u7684 Dubbo \u6ce8\u518c\u4e2d\u5fc3\u7ecf\u5e38\u6536\u5230 CPU \u4f7f\u7528\u7387\u7684\u544a\u8b66\uff0c\u4e8e\u662f\u8fdb\u884c\u4e86\u4e00\u6ce2\u4f18\u5316\uff0c\u6548\u679c\u8fd8\u4e0d\u9519 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-4721","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/4721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4721"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/4721\/revisions"}],"predecessor-version":[{"id":4855,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/4721\/revisions\/4855"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}