Skip to content

Commit

Permalink
satellite/durability: remove fmt.Sprintf from loop observer
Browse files Browse the repository at this point in the history
Small optimization.

name                 old time/op    new time/op    delta
DurabilityProcess-8    1.12ms ±12%    0.55ms ±14%  -50.99%  (p=0.008 n=5+5)

name                 old alloc/op   new alloc/op   delta
DurabilityProcess-8     300kB ± 0%     280kB ± 0%   -6.67%  (p=0.008 n=5+5)

name                 old allocs/op  new allocs/op  delta
DurabilityProcess-8     10.0k ± 0%      7.5k ± 0%  -25.00%  (p=0.008 n=5+5)

Change-Id: I8a75a315667490b255f2042fb2d781b8f4c7e75a
  • Loading branch information
mniewrzal committed Mar 19, 2024
1 parent 048966f commit 971d1e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions satellite/durability/observer.go
Expand Up @@ -5,7 +5,7 @@ package durability

import (
"context"
"fmt"
"strconv"
"time"

"github.com/zeebo/errs"
Expand Down Expand Up @@ -260,7 +260,7 @@ func (c *ObserverFork) Process(ctx context.Context, segments []rangedloop.Segmen

busFactorGroups := c.busFactorCache

streamLocation := fmt.Sprintf("%s/%d", s.StreamID, s.Position.Encode())
streamLocation := s.StreamID.String() + "/" + strconv.FormatUint(s.Position.Encode(), 10)
for classID, count := range controlledByClass {
if count == 0 {
continue
Expand Down

0 comments on commit 971d1e0

Please sign in to comment.