Repository navigation
perf: 基准矩阵扩容 + 性能文档重写(发版前全面测量) - #49
Merged
Merged
Conversation
- 新增基准:MetricsOverheadBenchmarks(指标微基准)、RawTcpFloorBenchmarks (裸 TCP 地板/框架税)、SessionAwareSend/Receive/IncompleteFrameTimeout (新特性三轮对比);EndToEnd 拆分为 OneWayThroughput(Framer×64B/1KB/64KB) 与 RoundTripLatency 两个类 - 关键结论(三轮稳定):指标无监听 0.5–1.0 ns/次零分配;SendInSessionAsync ≈2× SendAsync、+≈470 B/条;接收视图/超时关闭态无可测差异;框架税分尺寸 (小消息快于裸写 13–52%——队列流水线;64KB 约 3–4×——编码缓冲分配主导, 记为优化方向) - 过程修正:RawTcpFloor 初版接收只读一轮导致第二轮起 WriteAsync 永久阻塞, 改为常驻接收+每轮重置(与 e2e 同款模式) - bench/README 结果段全量重写(环境/两轮区间/噪声披露/框架税绝对+百分比 并列);README 双语性能摘要同步;demo 场景数描述更正(五场景)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
按确认的测试方案执行:四个问题的答案全部落进文档。
测量结果速览(详见 bench/README,含噪声披露)
Q2 新特性成本(三轮稳定,最扎实):
SendInSessionAsync≈ 2×SendAsync(+10~18 µs/条中位 +11)、+≈470 B/条分配(信封+完成源+注册表)——会话语义的诚实代价;GetSessionMessagesvsGetMessages)与未完成帧超时关闭态:无可测差异。Q3 框架税(并列绝对+百分比,最有意思的发现):
Q1/Q4 绝对水平(两轮区间,环境披露): 1KB ≈13–13.5 万条/秒、64B ≈21–24 万条/秒(LengthPrefix);RTT ≈66–74 µs。宏基准在本开发机上两轮漂移可达 ±30%,文档全部以区间+噪声披露呈现,微基准与差值结论三轮稳定。
工程变化
MetricsOverheadBenchmarks、RawTcpFloorBenchmarks、SessionAwareSend/Receive/IncompleteFrameTimeoutBenchmarks;EndToEndBenchmarks拆分为 OneWayThroughput(Framer × 64B/1KB/64KB)与 RoundTripLatency;WriteAsync永久阻塞(发现于第一轮执行)——改为常驻接收 + 每轮重置计数(与 e2e 同款模式);测试
84×3 = 252 全绿(基准工程不参与 dotnet test)。合并后走 2.4.0 发版。