Skip to content

Commit 64cf10c

Browse files
committed
revert sync.Pool experiment
1 parent 15389f1 commit 64cf10c

File tree

9 files changed

+108
-610
lines changed

9 files changed

+108
-610
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Readers can access the table always lock-free, while writers may synchronize usi
5959
that only one writer can modify the table persistent at a time, not using Compare-and-Swap (CAS)
6060
with all the known problems for multiple long-running writers.
6161

62-
The combination of lock-free concurrency, fast lookup and update times, low memory consumption,
63-
and optional internal data structure pooling provides clear advantages for any routing daemon.
62+
The combination of lock-free concurrency, fast lookup and update times and low memory consumption
63+
provides clear advantages for any routing daemon.
6464

6565
But as always, it depends on the specific use case.
6666

@@ -88,8 +88,6 @@ are used.
8888
//
8989
// A Table must not be copied by value; always pass by pointer.
9090

91-
func (t *Table[V]) WithPool() *Table[V]
92-
9391
func (t *Table[V]) Contains(ip netip.Addr) bool
9492
func (t *Table[V]) Lookup(ip netip.Addr) (val V, ok bool)
9593

@@ -155,8 +153,6 @@ Some delegated methods are pointless without a payload.
155153
Table[struct{}]
156154
}
157155

158-
func (l *Lite) WithPool() *Lite
159-
160156
func (l *Lite) Exists(pfx netip.Prefix) bool
161157
func (l *Lite) Contains(pfx netip.Prefix) bool
162158

internal/sparse/array256.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ func (a *Array256[T]) Clear(uint) {
6060
panic("forbidden, use DeleteAt")
6161
}
6262

63-
// Reset clears the Array256 by resetting the internal BitSet and item slice.
64-
// The capacity of the Items slice is retained to avoid reallocations.
65-
func (a *Array256[T]) Reset() {
66-
a.BitSet256 = bitset.BitSet256{}
67-
clear(a.Items) // zero all elements in the current slice
68-
a.Items = a.Items[:0] // reset length to zero but keep allocated capacity
69-
}
70-
7163
// Get returns the value at index i and whether it exists.
7264
//
7365
// If the bit for i is not set, ok is false and value is the zero-value of T.

lite.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ type Lite struct {
2323
Table[struct{}]
2424
}
2525

26-
// WithPool is an adapter for the underlying table.
27-
func (l *Lite) WithPool() *Lite {
28-
tbl := l.Table.WithPool()
29-
//nolint:govet // copy of *tbl is here by intention
30-
return &Lite{*tbl}
31-
}
32-
3326
// Exists returns true if the prefix exists in the table.
3427
// It's an adapter to [Table.Get].
3528
func (l *Lite) Exists(pfx netip.Prefix) bool {

multipool.go

Lines changed: 0 additions & 213 deletions
This file was deleted.

multipool_test.go

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)