From 031e2fbfcb1f683cc69e93adb238ffaba644fc29 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 8 Apr 2020 12:50:19 +0300 Subject: [PATCH] minimize allocations (#1472) * server: minimize allocations on re-register Signed-off-by: Vasiliy Tolstov * server: stop old instance before Init() Signed-off-by: Vasiliy Tolstov * client/grpc: fix allocations in protobuf marshal Signed-off-by: Vasiliy Tolstov * codec/json: fix allocations in protobuf marshal Signed-off-by: Vasiliy Tolstov * remove stop from init Signed-off-by: Vasiliy Tolstov * codec/grpc: expose MaxMessageSize Signed-off-by: Vasiliy Tolstov * codec: use buffer pool Signed-off-by: Vasiliy Tolstov * metadata: minimize reallocations Signed-off-by: Vasiliy Tolstov * util/wrapper: use metadata helper Signed-off-by: Vasiliy Tolstov * registry/cache: move logs to debug level Signed-off-by: Vasiliy Tolstov * server: move logs to debug level Signed-off-by: Vasiliy Tolstov * server: cache service only when Advertise is ip addr Signed-off-by: Vasiliy Tolstov * server: use metadata.Copy Signed-off-by: Vasiliy Tolstov --- cache.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cache.go b/cache.go index a68e32e..eb12d16 100644 --- a/cache.go +++ b/cache.go @@ -339,8 +339,8 @@ func (c *cache) run() { c.setStatus(err) if a > 3 { - if logger.V(logger.InfoLevel, logger.DefaultLogger) { - logger.Info("rcache: ", err, " backing off ", d) + if logger.V(logger.DebugLevel, logger.DefaultLogger) { + logger.Debug("rcache: ", err, " backing off ", d) } a = 0 } @@ -364,8 +364,8 @@ func (c *cache) run() { c.setStatus(err) if b > 3 { - if logger.V(logger.InfoLevel, logger.DefaultLogger) { - logger.Info("rcache: ", err, " backing off ", d) + if logger.V(logger.DebugLevel, logger.DefaultLogger) { + logger.Debug("rcache: ", err, " backing off ", d) } b = 0 }