From 6fcc5c5cb82139fefbb16761bb89a76f2fe9868f Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Thu, 29 Sep 2022 15:40:10 +0200 Subject: [PATCH] satellite/metabase/segmentloop: remove unused monkit calls Monkit calls for fast methods which are executed very frequently can slowdown whole process. This change removes monkit calls which are not used. See https://review.dev.storj.io/c/storj/storj/+/8498 as an example of speed improvement after removing monkit calls. Change-Id: If6567d80e05b748e6393b58a5142e43013107c61 --- satellite/metabase/segmentloop/service.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/satellite/metabase/segmentloop/service.go b/satellite/metabase/segmentloop/service.go index 900c46121..ca71c641f 100644 --- a/satellite/metabase/segmentloop/service.go +++ b/satellite/metabase/segmentloop/service.go @@ -502,7 +502,6 @@ func (loop *Service) iterateSegments(ctx context.Context, observers []*observerC } func withObservers(ctx context.Context, observers []*observerContext, handleObserver func(ctx context.Context, observer *observerContext) bool) []*observerContext { - defer mon.Task()(&ctx)(nil) nextObservers := observers[:0] for _, observer := range observers { keepObserver := handleObserver(ctx, observer) @@ -514,8 +513,6 @@ func withObservers(ctx context.Context, observers []*observerContext, handleObse } func handleSegment(ctx context.Context, observer *observerContext, segment *Segment) (err error) { - defer mon.Task()(&ctx)(&err) - if segment.Inline() { if err := observer.InlineSegment(ctx, segment); err != nil { return err