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
This commit is contained in:
Michal Niewrzal 2022-09-29 15:40:10 +02:00
parent 91c3a45874
commit 6fcc5c5cb8

View File

@ -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