Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! 𝐉𝐚𝐯𝐚有𝐝𝐮𝐛𝐛𝐨, 𝐆𝐨𝐥𝐚𝐧𝐠有𝐫𝐩𝐜𝐱! build for cloud!
rewrite this part code.
when initional i calc the server's weight ,and then add them to a ring.
and then select the server ,only get it from ring.
benchmark
from
goos: linux
goarch: amd64
pkg: github.com/smallnest/rpcx/client
cpu: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
BenchmarkWeightedRoundRobinSelector_Select
BenchmarkWeightedRoundRobinSelector_Select-8 52450845 19.27 ns/op
to
goos: linux
goarch: amd64
pkg: github.com/smallnest/rpcx/client
cpu: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
BenchmarkWeightedRoundRobinSelector_Select
BenchmarkWeightedRoundRobinSelector_Select-8 384278872 3.044 ns/op
but i think it shuod add a rwlock, old code didn't use it .
update smmoth_round_roubine
rewrite this part code. when initional i calc the server's weight ,and then add them to a ring. and then select the server ,only get it from ring. benchmark from
to
but i think it shuod add a rwlock, old code didn't use it .