Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
AlexStocks merged PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5503448705 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [10.4% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5503446123
> `UnaryFastPath` 是普通 `bool`,未赋值时默认就是 `false`:
>
> 如果我传入其他配置 但是不传入UnaryFastPath
>
> ```go
> cfg := &global.TripleConfig{
> KeepAliveInterval: "10s",
> }
> // cfg.UnaryFastPath == false 如果不显式指定会被默认赋值为false
> ```
>
> 会导致 默认值是true 但是如果显式指定了其他的配置而不指定UnaryFastPath会变成false
感谢 review!的确,`UnaryFastPath` 之前是普通 `bool`,零值 `false`。任何不经过
`DefaultTripleConfig()` 构造的 `TripleConfig`(比如手动
`&TripleConfig{KeepAliveInterval: "10s"}`),该字段都会退化为 `false`,导致默认开启的快路径被意外关闭。
已修复,具体改动如下:
代码改动:
`UnaryFastPath bool` → `UnaryFastPath *bool`,语义为:
| 取值 | 含义 | 行为 |
| --- | --- | --- |
| `nil` | 未显式设置 | 走默认(开启) |
| `true` | 显式开启 | 开启 |
| `false` | 显式关闭 | 关闭(回滚) |
- `DefaultTripleConfig()` 填 `&true`,保证默认开启
- `Clone()` 对 `*bool` 做深拷贝,对齐 `global` 包既有风格
- 消费点(`protocol/triple/client.go`)改为 `UnaryFastPath == nil ||
*UnaryFastPath` 判断
- yaml/json 缺省时字段为 `nil`,与旧配置兼容;仅显式赋值处需要适配
测试改动:
在 `TestCallUnaryFastPathWireSignature`中补充用例:
- `default-on`:`tripleConf == nil` → 快路径开启
- `explicitly-on`:`UnaryFastPath: true` → 快路径开启
- `explicitly-off`:`UnaryFastPath: false` → 回退 duplex
- `unset-keeps-default`:`&TripleConfig{KeepAliveInterval: "10s"}`不设开关→
快路径仍保持开启
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5501778824 > Good job.Please provide some additional explanation:This optimization primarily targets small, CPU-dominated unary requests. The fast path buffers the complete request body before submitting it to the transport. For large or highly concurrent requests, memory residency and buffer growth may increase, and the performance benefit is not guaranteed. The current implementation does not automatically fall back based on payload size.However, judging from the size of the data you test, it already covers most scenarios of RPC business, and particularly large packages are also considered abnormal situations. Just add the above explanation to it Thanks for your review! I've also tested and confirmed the performance boundaries. The main benefit of the fast path is for messages in the range of 128 B ~ 32 KiB, and I've added comments in the code as suggested. Changes: 1. `protocol/triple/triple_protocol/unary_fastpath.go` — comment for the `unaryFastPathCall` type 2. `protocol/triple/triple_protocol/option.go` — comment for the `WithUnaryFastPath()` option The comments added in both places are worded identically: ```go // This optimization primarily targets small, CPU-dominated unary requests, // roughly in the 128 B to 32 KiB range: the complete request body is // buffered before it is submitted to the transport. For large or highly // concurrent requests, memory residency and buffer growth may increase, and // the performance benefit is not guaranteed. The implementation does not // automatically fall back based on payload size. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5501556094 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [10.5% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5496522843 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [10.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
Alanxtl commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5487729264 update to latest develop to fix the ci fail -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5458647335 CI是-race问题,已提PR #3713 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on code in PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#discussion_r3884574592
##
protocol/triple/client.go:
##
@@ -181,6 +181,16 @@ func newClientManager(url *common.URL) (*clientManager,
error) {
}
cliOpts = append(cliOpts, clientKeepAliveOpts...)
+ // The unary fast path is on by default. It only applies to the Triple
+ // (connect) protocol; the client below defaults to the gRPC wire
format.
+ if tripleConf != nil {
+ if tripleConf.UnaryFastPath {
+ cliOpts = append(cliOpts, tri.WithUnaryFastPath())
Review Comment:
感谢评审,做出以下改动:
- 测试入口改为生产链路:TripleProtocol.Refer(url) 获取真实 Invoker(URL 显式带 IDLMode=NONIDL
确保走 NewTripleInvoker),构造真实 invocation 后经 TripleInvoker.Invoke 发起,完整经过
parseInvocation、attachment 合并、clientManager.callUnary 的实际生产调用链;
- 保留服务端观察点:继续通过服务端收到的 Content-Length 区分 fast path(>0)与 duplex(-1);
- 修复测试:Refer 会启动后台 gRPC health check 流(streaming
请求,Content-Length=-1),会覆盖服务端签名捕获,已排除 grpc.health.v1.Health/* 前缀的流后再断言
mutant验证:
protocol_grpc.go改动为
```go
func (g *grpcClient) NewConn(
ctx context.Context,
spec Spec,
header http.Header,
) StreamingClientConn {
if deadline, ok := ctx.Deadline(); ok {
if encodedDeadline, err :=
grpcEncodeTimeout(time.Until(deadline)); err == nil {
header[grpcHeaderTimeout] = []string{encodedDeadline}
}
}
var call unaryClientCall
if false && spec.StreamType == StreamTypeUnary && g.UnaryFastPath { //
MUTANT: fast branch severed
// Unary fast path: no io.Pipe, no per-request goroutine.
Streaming
// calls always keep using duplexHTTPCall.
call = newUnaryFastPathCall(
ctx,
g.HTTPClient,
g.URL,
spec,
header,
g.BufferPool,
)
} else {
call = newDuplexHTTPCall(ctx, g.HTTPClient, g.URL, spec, header)
}
```
运行
```bash
GOTOOLCHAIN=go1.25.6 go test ./protocol/triple/ -run
'TestCallUnaryFastPathWireSignature' -count=1 -v
```
输出
```bash
--- FAIL: TestCallUnaryFastPathWireSignature (0.01s)
--- FAIL: TestCallUnaryFastPathWireSignature/default-on (0.01s)
Messages: server saw Content-Length -1, want > 0 (fast path
signature)
--- PASS: TestCallUnaryFastPathWireSignature/explicitly-off (0.00s)
FAIL
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5457897865 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [10.6% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
AlexStocks commented on code in PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#discussion_r3883684187
##
protocol/triple/client.go:
##
@@ -181,6 +181,16 @@ func newClientManager(url *common.URL) (*clientManager,
error) {
}
cliOpts = append(cliOpts, clientKeepAliveOpts...)
+ // The unary fast path is on by default. It only applies to the Triple
+ // (connect) protocol; the client below defaults to the gRPC wire
format.
+ if tripleConf != nil {
+ if tripleConf.UnaryFastPath {
+ cliOpts = append(cliOpts, tri.WithUnaryFastPath())
Review Comment:
[P1] 生产 dispatch 已接入,但回归测试仍绕过真正的 Refer/Invoker 入口
当前 gRPC unary 代码已经能按 `UnaryFastPath` 选择 `unaryFastPathCall`,但新增的所谓
public-entry 测试仍直接调用未导出的 `newClientManager` 和 `cm.callUnary`,没有经过
`TripleProtocol.Refer` 的 Invoker 选择、`NewTripleInvoker` 创建以及
`TripleInvoker.Invoke` 对 invocation、metadata、attachment 和 context 的生产转换。即使真实
Reference 入口以后重新走到其他 Invoker、没有把全局 `TripleConfig` 挂到 URL,或 `Invoke` 不再调用该
manager,这个测试仍会全绿。请从 `TripleProtocol.Refer` 获取实际 Invoker 后发起 unary 调用,继续用服务端观察到的
`Content-Length` 区分 fast/duplex,并用断开 `grpcClient.NewConn` fast 分支的 mutant
证明用例会失败。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on code in PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#discussion_r3879822289
##
protocol/triple/client.go:
##
@@ -181,6 +181,16 @@ func newClientManager(url *common.URL) (*clientManager,
error) {
}
cliOpts = append(cliOpts, clientKeepAliveOpts...)
+ // The unary fast path is on by default. It only applies to the Triple
+ // (connect) protocol; the client below defaults to the gRPC wire
format.
+ if tripleConf != nil {
+ if tripleConf.UnaryFastPath {
+ cliOpts = append(cliOpts, tri.WithUnaryFastPath())
Review Comment:
感谢评审。已按第一种方案修复:保持默认 gRPC wire 兼容,把 fast path 接入真实 unary client
代码变更:
- grpcClient.NewConn 增加 fastpath 分支:unary 且开关开启走
newUnaryFastPathCall,否则走newDuplexHTTPCall;流式恒走 duplex,WithTriple() 路径未动
- duplexCall 字段改为 unaryClientCall 接口,CloseResponse 改经 ResponseTrailer() 读取
trailer
添加以下测试:
- TestUnaryFastPathGRPCRoutesUnary:gRPC 路由断言(开→fastpath / 关→duplex /
流式→duplex)
- TestCallUnaryFastPathWireSignature:从公开入口 clientManager.callUnary
发起,断言服务端收到预声明 Content-Length(fastpath)与 -1(duplex)
- TestCallUnaryFastPathErrorPaths:handler 错误、trailers-only、context
取消在两条路径上传播等价
当前行为:
- 默认配置下,gRPC wire 的 unary 请求由 pipe 流式发送改为整包缓冲 + 预声明 Content-Length,无每请求
goroutine
- 关闭开关后回退 duplex,与之前一致;流式行为不变
- 当用户配置triple协议时,同样快路径默认生效
- 编码统一grpc,保护兼容性
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5451122497 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [9.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
AlexStocks commented on code in PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#discussion_r3878265880
##
protocol/triple/client.go:
##
@@ -181,6 +181,16 @@ func newClientManager(url *common.URL) (*clientManager,
error) {
}
cliOpts = append(cliOpts, clientKeepAliveOpts...)
+ // The unary fast path is on by default. It only applies to the Triple
+ // (connect) protocol; the client below defaults to the gRPC wire
format.
+ if tripleConf != nil {
+ if tripleConf.UnaryFastPath {
+ cliOpts = append(cliOpts, tri.WithUnaryFastPath())
Review Comment:
[P1] 这个开关没有进入实际 Dubbo Triple unary 生产路径
这里仅设置 `WithUnaryFastPath`,但当前 HTTP/2/HTTP/3 分支没有设置
`WithTriple()`;`tri.NewClient` 因而仍构造默认 `grpcClient`,而 `grpcClient.NewConn`
无论开关值都固定使用 `newDuplexHTTPCall`。唯一追加 `WithTriple()` 的 `CallHTTP` case 又不会被上方
`callProtocol` 的实际赋值命中。结果是默认 `UnaryFastPath=true` 对 `TripleProtocol.Refer ->
TripleInvoker.Invoke -> clientManager.callUnary` 无效,生产热路径仍使用 pipe 和请求
goroutine。现有 benchmark 显式传入 `WithTriple()`,其他测试直接构造 `tripleClient`,都覆盖不到这处
dispatch 断链。请在保持默认 gRPC wire 兼容的前提下把 fast path 接到真实 unary client,或把能力限制为低层
`WithTriple` client 并移除无效的全局配置;同时补从公开 Dubbo Triple unary 入口出发的回归测试。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5443930532 connect与dubbo-java兼容性问题并没有解决,ci通过与新修复有关: 修复原先将默认协议grpc改为triple协议的bug,恢复默认协议,优化仅当用户在transport显示设置triple协议时快路径生效,当前默认grpc协议与编码,因此不会触发兼容性问题报错 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5443517463 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [7.1% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5442004580
> Dubbo Java 怎么可能不支持triple呢
dubbo-java 支持 triple,兼容性问题不在协议,在content-type,triple 在 dubbo-go 里有两种 wire
编码,分别是gRPC 编码Content-Type application/grpc+proto和connect 编码Content-Type
application/proto,dubbo-java 支持 是 gRPC 编码的 triple。
之前出于改动范围集中于“只优化triple协议的性能”,只优化triple协议,绕开grpc协议,不让fastpath的开关挂在grpc协议上而是挂在另一个路径connect,被迫应用connect编码,从而引发兼容性问题;如果把优化开关挂在grpc编码上,可以解决这个问题,应用grpc编码可以避免兼容性问题,不过这个行为同时会带来grpc协议路径也得到优化。
一些代码示例,如果使用grpc编码,就需要把开关放在`protocol_grpc.go`,自然有grpc性能收益:
`protocol_grpc.go`
```go
var call unaryClientCall
if spec.StreamType == StreamTypeUnary && g.UnaryFastPath {
call = newUnaryFastPathCall(
ctx,
g.HTTPClient,
g.URL,
spec,
header,
g.BufferPool,
)
} else {
call = newDuplexHTTPCall(
ctx,
g.HTTPClient,
g.URL,
spec,
header,
)
}
conn := &grpcClientConn{ ... }
```
原因是wire与协议的设置是绑定的,绕开grpc协议就会绕开grpc编码,这个文件就是 gRPC 编码的唯一实现,grpcClient.NewConn
是 gRPC 编码请求的唯一入口,所以应用grpc编码即是应用grpc协议
这个改动就是我之前提出的“优化grpc协议下的triple-unary路径”改动,把开关挂在grpc编码上,然后无论用户设置的是triple协议还是grpc协议,都得到优化,并且保证兼容性
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
Alanxtl commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5440637200 dubbo java 怎么可能不支持triple呢 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5440264142 CI的集成测试错误排查如下: 非偶发错误,仅该PR稳定复现,go 客户端调用 dubbo-java 服务端返回 415 Unsupported Media Type 'application/proto'。根因是 commit d6a6ce49f 把 tri.WithTriple() 从 HTTP/1.1 分支提升为无条件启用,导致所有 Triple 客户端默认改用 connect 编码(Content-Type: application/proto),而 dubbo-java 服务端只识别 gRPC 编码(application/grpc+proto)。 目前想到的方案是优化grpc协议下的triple-unary路径 改动量涉及一个文件:`protocol_grpc.go`,和部分注释与测试同步修改。尽管本项目旨在优化triple协议的triple-unary路径,但是grpc协议下优化同样具有收益(且高于triple协议),但这里是否需要扩大优化范围?若可以我会调整PR描述并追加commit grpc协议的triple-unary优化效果如下: ### 128 bytes payload | Metric | Concurrency | duplex | fastpath | Improvement | | --- | --- | --- | --- | --- | | QPS | 50 | 4,425.4 | 6,158.7 | +39.2% ↑ | | QPS | 100 | 4,537.6 | 6,738.7 | +48.5% ↑ | | P99 latency (ms) | 50 | 19.56 | 17.32 | -11.4% ↑ | | P99 latency (ms) | 100 | 33.29 | 28.74 | -13.7% ↑ | ### 1024 bytes payload | Metric | Concurrency | duplex | fastpath | Improvement | | --- | --- | --- | --- | --- | | QPS | 50 | 3,597.7 | 4,939.3 | +37.3% ↑ | | QPS | 100 | 3,670.8 | 5,171.3 | +40.9% ↑ | | P99 latency (ms) | 50 | 21.51 | 20.70 | -3.8% ↑ | | P99 latency (ms) | 100 | 42.96 | 35.35 | -17.7% ↑ | ### 16384 bytes payload | Metric | Concurrency | duplex | fastpath | Improvement | | --- | --- | --- | --- | --- | | QPS | 50 | 1,980.3 | 2,402.7 | +21.3% ↑ | | QPS | 100 | 1,829.6 | 2,439.2 | +33.3% ↑ | | P99 latency (ms) | 50 | 43.24 | 36.97 | -14.5% ↑ | | P99 latency (ms) | 100 | 93.16 | 77.70 | -16.6% ↑ | ### 1048576 bytes (1MiB) payload | Metric | Concurrency | duplex | fastpath | Improvement | | --- | --- | --- | --- | --- | | QPS | 50 | 122.9 | 133.7 | +8.8% ↑ | | QPS | 100 | 119.4 | 101.5 | -15.0% ↓ | | P99 latency (ms) | 50 | 1,074.68 | 1,063.45 | -1.0% ↑ | | P99 latency (ms) | 100 | 2,400.09 | 3,148.26 | +31.2% ↓ | ## benchstat -count10 ```bash goos: linux goarch: amd64 pkg: dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol cpu: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz │ duplex10.txt │fastpath10.txt │ │ sec/op │ sec/op vs base │ GRPCUnary/128B-12 145.1µ ± 33% 125.9µ ± 11% -13.24% (p=0.000 n=10) GRPCUnary/1024B-12 171.7µ ± 2% 118.4µ ± 17% -31.05% (p=0.000 n=10) GRPCUnary/16384B-12216.8µ ± 12% 184.6µ ± 16% -14.87% (p=0.001 n=10) GRPCUnary/1MiB-12 3.256m ± 13% 3.165m ± 13%~ (p=0.165 n=10) geomean364.2µ 305.5µ-16.11% ``` | Payload | duplex (sec/op) | fastpath (sec/op) | Change | p-value | Significance | | --- | --- | --- | --- | --- | --- | | 128B | 145.1µs | 125.9µs | -13.24% | 0.000 | Significant | | 1KiB | 171.7µs | 118.4µs | -31.05% | 0.000 | Significant | | 16KiB | 216.8µs | 184.6µs | -14.87% | 0.001 | Significant | | 1MiB | 3.256ms | 3.165ms | -2.8% | 0.165 | Not significant | | geomean | 364.2µs | 305.5µs | -16.11% | - | Overall positive | 也同时尝试过以下方案,但都有一定缺陷 1. 保留默认triple优化,fastpath 显式开启时才切 connect 编码 :fastpath 默认关,WithTriple() 改成只有用户显式开 UnaryFastPath 才追加。但是默认关用户没收益;如果要有收益开启fastpath 会被强制切 connect 编码,连接dubbo-java 出现415,只能在优化收益和兼容性二选一 2. Triple 协议内支持 gRPC 编码模式:triple 客户端内部多支持一种 gRPC 编码,默认发 gRPC 保证兼容性。 但是connect 和 gRPC 是两套完全独立的实现(不同的 marshaler/unmarshaler、错误模型、header 约定)。支持grpc编码模式相当于把 grpcClientConn 全套逻辑复制进 protocol_triple.go,server 端还需要双 content-type,类似于重复造轮子,收益不高。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on code in PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#discussion_r3870754195
##
protocol/triple/triple_protocol/unary_fastpath.go:
##
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package triple_protocol
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "sync"
+)
+
+// unaryClientCall is the subset of *duplexHTTPCall that tripleUnaryClientConn
+// depends on. unary calls use unaryFastPathCall; streaming calls keep using
+// duplexHTTPCall.
+type unaryClientCall interface {
+ io.Writer
+ io.Reader
+ Header() http.Header
+ CloseWrite() error
+ CloseRead() error
+ BlockUntilResponseReady()
+ SetValidateResponse(func(*http.Response) *Error)
+ SetError(error)
+ ResponseTrailer() http.Header
+}
+
+// Both the original and the fast path must satisfy the interface.
+var (
+ _ unaryClientCall = (*duplexHTTPCall)(nil)
+ _ unaryClientCall = (*unaryFastPathCall)(nil)
+)
+
+// unaryFastPathCall is a synchronous replacement for duplexHTTPCall on the
+// unary hot path. Write accumulates the marshaled payload into a pooled
+// buffer; CloseWrite issues the request synchronously (no io.Pipe, no
+// per-request goroutine).
+type unaryFastPathCall struct {
+ ctx context.Context
+ httpClient HTTPClient
+ request *http.Request
+ bufferPool *bufferPool
+ validateResponse func(*http.Response) *Error
+
+ // writeMu serializes Write against CloseWrite. StreamingClientConn's
+ // contract requires Send and CloseRequest to be safe to call
concurrently;
+ // CloseWrite runs makeRequest synchronously under this lock.
+ writeMu sync.Mutex
+
+ // body accumulates the marshaled payload between Write and CloseWrite.
+ body *bytes.Buffer
+
+ // bodySent is set once makeRequest hands the body to the transport; a
+ // later Write then returns io.EOF instead of racing with the transport.
+ bodySent bool
+
+ errMu sync.Mutex
+ err error
+
+ response *http.Response
+ responseReady chan struct{}
+
+ sendOnce sync.Once
+}
+
+func newUnaryFastPathCall(
+ ctx context.Context,
+ httpClient HTTPClient,
+ url *url.URL,
+ spec Spec,
+ header http.Header,
+ bufferPool *bufferPool,
+) *unaryFastPathCall {
+ // Clone the URL so a transport we don't control can't mutate the
caller's,
+ // then bind the concrete RPC path.
+ url = cloneURL(url)
+ url.Path = spec.Procedure
+ url.RawPath = ""
+ request := (&http.Request{
+ Method: http.MethodPost,
+ URL:url,
+ Header: header,
+ Proto: "HTTP/1.1",
+ ProtoMajor: 1,
+ ProtoMinor: 1,
+ Host: url.Host,
+ }).WithContext(ctx)
+ return &unaryFastPathCall{
+ ctx: ctx,
+ httpClient:httpClient,
+ request: request,
+ bufferPool:bufferPool,
+ responseReady: make(chan struct{}),
+ }
+}
+
+// Write accumulates the request payload into the pooled body buffer. Unlike
+// duplexHTTPCall.Write it never touches the network.
+func (c *unaryFastPathCall) Write(data []byte) (int, error) {
+ c.writeMu.Lock()
+ defer c.writeMu.Unlock()
+ if c.bodySent {
+ // A racing CloseWrite already handed the body to the transport;
+ // writing now would race with its background read. Mirror
+ // duplexHTTPCall.Write, which returns io.EOF once the pipe is
closed.
+ return 0, io.EOF
+ }
+ if err := c.getError(); err != nil {
+ return 0, err
+ }
+ if err := c.ctx.Err(); err != nil {
+ c.SetError(err)
+ return 0, wrapIfContextError(err)
+ }
+ if c.body == nil {
+ c.body = c.bufferPool.Get()
+ }
+ return c.body.Write(data)
+}
Review Comment:
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5437309822 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [7.1% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
lizining1231 commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5437094045 > 1. the ci fails > 2. > add an opt-in UnaryFastPath toggle, off by default > > why not just set it to on by default, is there a competiable issue between fastpath call and duplex call thanks for review **About compatibility issue** There is no compatibility break between the fast path and the duplex call, they are wire- and API-compatible, but they have deliberately different runtime behavior, and we didn't want to silently switch every existing user onto a new execution path before it's validated at scale. **1. Wire-compatible:** TestUnaryFastPathWireConsistent asserts both paths emit byte-identical requests. **2. API-compatible:** WithUnaryFastPath is a new opt-in ClientOption. With it off (the default), callers keep using duplexHTTPCall unchanged, no public API signature or behavior change. **3. Scoped to unary-on-Triple only:** the switch applies only when spec.StreamType == StreamTypeUnary && UnaryFastPath. Client/server/bidi streaming always use duplexHTTPCall, and the gRPC protocol never reads this toggle, so those paths are untouched. **4. Contract preserved:** the StreamingClientConn concurrency contract (Send / RequestHeader / CloseRequest may race) is satisfied, writeMu serializes Write vs CloseWrite, and Write after CloseWrite returns io.EOF, mirroring the duplex pipe-close semantics. Covered by unary_fastpath_concurrency_test.go under -race. **About ci fail** CI is red on the integrate test. Likely the known flaky samples step: the last go-client call hits the Java server, which only accepts application/grpc+proto while the dubbo-go client sends application/proto, so that step 415s whenever the Java server starts in time — it only "passes" when the Java server fails to start and the step is skipped. The root cause is in the samples test flow, not this PR. Fix in progress. **About the triple-unary optimization option defaulting to off** When I implemented it, I considered that users might not want to apply this change, so I set it to off by default. I have now changed it to on by default. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5437010045 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [4.1% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
Alanxtl commented on code in PR #3706:
URL: https://github.com/apache/dubbo-go/pull/3706#discussion_r3868040015
##
protocol/triple/triple_protocol/unary_fastpath.go:
##
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package triple_protocol
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+ "net/http"
+ "net/url"
+ "sync"
+)
+
+// unaryClientCall is the subset of *duplexHTTPCall that tripleUnaryClientConn
+// depends on. unary calls use unaryFastPathCall; streaming calls keep using
+// duplexHTTPCall.
+type unaryClientCall interface {
+ io.Writer
+ io.Reader
+ Header() http.Header
+ CloseWrite() error
+ CloseRead() error
+ BlockUntilResponseReady()
+ SetValidateResponse(func(*http.Response) *Error)
+ SetError(error)
+ ResponseTrailer() http.Header
+}
+
+// Both the original and the fast path must satisfy the interface.
+var (
+ _ unaryClientCall = (*duplexHTTPCall)(nil)
+ _ unaryClientCall = (*unaryFastPathCall)(nil)
+)
+
+// unaryFastPathCall is a synchronous replacement for duplexHTTPCall on the
+// unary hot path. Write accumulates the marshaled payload into a pooled
+// buffer; CloseWrite issues the request synchronously (no io.Pipe, no
+// per-request goroutine).
+type unaryFastPathCall struct {
+ ctx context.Context
+ httpClient HTTPClient
+ request *http.Request
+ bufferPool *bufferPool
+ validateResponse func(*http.Response) *Error
+
+ // writeMu serializes Write against CloseWrite. StreamingClientConn's
+ // contract requires Send and CloseRequest to be safe to call
concurrently;
+ // CloseWrite runs makeRequest synchronously under this lock.
+ writeMu sync.Mutex
+
+ // body accumulates the marshaled payload between Write and CloseWrite.
+ body *bytes.Buffer
+
+ // bodySent is set once makeRequest hands the body to the transport; a
+ // later Write then returns io.EOF instead of racing with the transport.
+ bodySent bool
+
+ errMu sync.Mutex
+ err error
+
+ response *http.Response
+ responseReady chan struct{}
+
+ sendOnce sync.Once
+}
+
+func newUnaryFastPathCall(
+ ctx context.Context,
+ httpClient HTTPClient,
+ url *url.URL,
+ spec Spec,
+ header http.Header,
+ bufferPool *bufferPool,
+) *unaryFastPathCall {
+ // Clone the URL so a transport we don't control can't mutate the
caller's,
+ // then bind the concrete RPC path.
+ url = cloneURL(url)
+ url.Path = spec.Procedure
+ url.RawPath = ""
+ request := (&http.Request{
+ Method: http.MethodPost,
+ URL:url,
+ Header: header,
+ Proto: "HTTP/1.1",
+ ProtoMajor: 1,
+ ProtoMinor: 1,
+ Host: url.Host,
+ }).WithContext(ctx)
+ return &unaryFastPathCall{
+ ctx: ctx,
+ httpClient:httpClient,
+ request: request,
+ bufferPool:bufferPool,
+ responseReady: make(chan struct{}),
+ }
+}
+
+// Write accumulates the request payload into the pooled body buffer. Unlike
+// duplexHTTPCall.Write it never touches the network.
+func (c *unaryFastPathCall) Write(data []byte) (int, error) {
+ c.writeMu.Lock()
+ defer c.writeMu.Unlock()
+ if c.bodySent {
+ // A racing CloseWrite already handed the body to the transport;
+ // writing now would race with its background read. Mirror
+ // duplexHTTPCall.Write, which returns io.EOF once the pipe is
closed.
+ return 0, io.EOF
+ }
+ if err := c.getError(); err != nil {
+ return 0, err
+ }
+ if err := c.ctx.Err(); err != nil {
+ c.SetError(err)
+ return 0, wrapIfContextError(err)
+ }
+ if c.body == nil {
+ c.body = c.bufferPool.Get()
+ }
+ return c.body.Write(data)
+}
Review Comment:
在
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
Alanxtl commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5433010641 pls fix the ci fail -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5431445664 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [4.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
codecov-commenter commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5431439396 ## [Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report :x: Patch coverage is `82.73381%` with `24 lines` in your changes missing coverage. Please review. :white_check_mark: Project coverage is 56.29%. Comparing base ([`60d1c2a`](https://app.codecov.io/gh/apache/dubbo-go/commit/60d1c2a949f0ee0da4be3fe09fb79d295491e040?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`85d7146`](https://app.codecov.io/gh/apache/dubbo-go/commit/85d7146afe43ab86b8e0389e863e995e29bc3805?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)). :warning: Report is 957 commits behind head on develop. | [Files with missing lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [protocol/triple/triple\_protocol/unary\_fastpath.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&filepath=protocol%2Ftriple%2Ftriple_protocol%2Funary_fastpath.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHJvdG9jb2wvdHJpcGxlL3RyaXBsZV9wcm90b2NvbC91bmFyeV9mYXN0cGF0aC5nbw==) | 85.08% | [12 Missing and 5 partials :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | | [protocol/triple/triple\_protocol/option.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&filepath=protocol%2Ftriple%2Ftriple_protocol%2Foption.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHJvdG9jb2wvdHJpcGxlL3RyaXBsZV9wcm90b2NvbC9vcHRpb24uZ28=) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | | [protocol/triple/client.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&filepath=protocol%2Ftriple%2Fclient.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHJvdG9jb2wvdHJpcGxlL2NsaWVudC5nbw==) | 33.33% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | | [protocol/triple/triple\_protocol/protocol\_triple.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&filepath=protocol%2Ftriple%2Ftriple_protocol%2Fprotocol_triple.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHJvdG9jb2wvdHJpcGxlL3RyaXBsZV9wcm90b2NvbC9wcm90b2NvbF90cmlwbGUuZ28=) | 93.75% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop#3706 +/- ## === + Coverage46.76% 56.29% +9.53% === Files 295 477 +182 Lines1717237597 +20425 === + Hits 803121167 +13136 - Misses828714773+6486 - Partials 854 1657 +803 ``` [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/dubbo-go/pull/3706?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache). :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache). :rocket: New features to boost your workflow: - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail:
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5431380831 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [4.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(triple): performance optimization for Triple unary hot path [dubbo-go]
sonarqubecloud[bot] commented on PR #3706: URL: https://github.com/apache/dubbo-go/pull/3706#issuecomment-5431334967 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) **Quality Gate passed** Issues  [4 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3706&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3706&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_coverage&view=list)  [4.2% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3706&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3706) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
