mochengqian commented on issue #1045: URL: https://github.com/apache/dubbo-go-pixiu/issues/1045#issuecomment-5707610012
> 你好,我愿意尝试认领这个 issue。 我目前理解这次工作的目标是在保持现有 routing / snapshot / health 语义不变的前提下,优化必须全量重建时的成本: > > RingHash:避免逐 host Add 导致反复排序,改为批量生成全部虚拟节点和位置归属,最后统一排序一次; Maglev:不再为每个 host 预生成完整长度 M 的 permutation,而只维护 offset / skip / next 等状态,在填表时按需计算候选位置,把主要中间空间从 O(NM + M) 降为 O(N + M)。 > > 我会先梳理 [#932](https://github.com/apache/dubbo-go-pixiu/pull/932) 以及当前 snapshot rebuild / cache reuse 路径,然后分别做等价性测试和 benchmark,重点验证: > > RingHash 与当前逐项 Add 的 position ownership 和 Get/GetHash 等价; Maglev 在相同 host 顺序和算术语义下得到相同最终表; 新 snapshot 不修改旧 snapshot; health change / address change / hash parameter change 等场景保持现有行为; 补充 allocation / benchmark,对比 ns/op、B/op、allocs/op 和大型 Maglev 的 heap 使用。 > > RingHash 这部分想先确认一下:维护者更倾向于给 gost 增加 batch API,再由 Pixiu 接入,还是先在 Pixiu 内部实现兼容 builder? > > 如果这个方向符合预期,我可以继续推进实现。 lgtm,just go ahead~ 建议在 gost 新增批量建环 API,保持原有 Add/Remove 行为不变,仅把全量构建切换到新 API。 建议先做好修改前的benchmark用于对比。@ka-snap1 -- 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]
