Skip to content

Commit

Permalink
refactor: use compression pool to reduce GC
Browse files Browse the repository at this point in the history
Signed-off-by: kaixuan xu <triumph_9431@qq.com>
  • Loading branch information
xkx9431 committed Dec 21, 2024
1 parent fd6aa6b commit 1d61bf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pool/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestCachePool(t *testing.T) {
}

if pool.AvailableOffers() != 1 {
t.Errorf("expected pool lefted capcity to be 1, got %d", pool.AvailableOffers())
t.Errorf("The expected remaining capacity of the pool is 1, got %d", pool.AvailableOffers())
}
pool.Put(item2)

Expand All @@ -59,13 +59,13 @@ func TestCachePool(t *testing.T) {
}

if pool.AvailableOffers() != 0 {
t.Errorf("expected pool lefted capcity to be 0, got %d", pool.AvailableOffers())
t.Errorf("The expected remaining capacity of the pool is 0, got %d", pool.AvailableOffers())
}

pool.Put(item3)
pool.Put(item4)

if pool.AvailableOffers() != 2 {
t.Errorf("expected pool lefted capcity to be 2, got %d", pool.AvailableOffers())
t.Errorf("The expected remaining capacity of the pool is 2, got %d", pool.AvailableOffers())
}
}

0 comments on commit 1d61bf0

Please sign in to comment.