Skip to content

Commit

Permalink
sticky: vendor go-rbtree, drop external dep
Browse files Browse the repository at this point in the history
The go-rbtree dep was only used for the sticky package, and we used
~half the code: we used none of the powerful iteration, which was
created and used only in an early version of this code.

Dropping this has potentially very minor speedups and theoretically a
few less allocations. As expected, this doesn't really show in any
benchmarks:

name                            old time/op    new time/op    delta
Large-12                          3.86ms ±16%    3.89ms ±18%    ~     (p=0.971 n=10+10)
LargeWithExisting-12              8.96ms ± 5%    8.56ms ± 6%  -4.46%  (p=0.023 n=10+10)
LargeImbalanced-12                4.64ms ±14%    4.58ms ±11%    ~     (p=0.481 n=10+10)
LargeWithExistingImbalanced-12    8.78ms ±10%    8.74ms ±10%    ~     (p=0.796 n=10+10)
Java/large-12                      178ms ± 1%     177ms ± 1%  -0.66%  (p=0.023 n=10+10)
Java/large_imbalance-12            215ms ± 4%     215ms ± 4%    ~     (p=0.739 n=10+10)
Java/medium-12                    10.5ms ± 5%    11.3ms ±22%    ~     (p=0.315 n=8+10)
Java/medium_imbalance-12          13.3ms ± 9%    13.4ms ± 8%    ~     (p=0.730 n=9+9)
Java/small-12                     8.45ms ± 5%    8.98ms ±22%    ~     (p=0.573 n=8+10)
Java/small_imbalance-12           10.9ms ± 9%    10.5ms ±11%    ~     (p=0.113 n=9+10)

name                            old alloc/op   new alloc/op   delta
Large-12                          1.87MB ± 0%    1.87MB ± 0%    ~     (p=0.352 n=9+9)
LargeWithExisting-12              1.97MB ± 0%    1.97MB ± 0%    ~     (p=0.971 n=10+10)
LargeImbalanced-12                2.07MB ± 1%    2.07MB ± 1%    ~     (p=0.853 n=10+10)
LargeWithExistingImbalanced-12    2.01MB ± 0%    2.01MB ± 0%    ~     (p=0.063 n=10+10)
Java/large-12                      125MB ± 0%     125MB ± 0%    ~     (p=0.306 n=10+9)
Java/large_imbalance-12            129MB ± 0%     129MB ± 0%    ~     (p=0.398 n=9+9)
Java/medium-12                    7.69MB ± 0%    7.69MB ± 0%    ~     (p=0.985 n=10+10)
Java/medium_imbalance-12          7.97MB ± 0%    7.97MB ± 0%  -0.00%  (p=0.000 n=10+9)
Java/small-12                     6.11MB ± 0%    6.11MB ± 0%    ~     (p=0.095 n=10+9)
Java/small_imbalance-12           6.34MB ± 0%    6.34MB ± 0%    ~     (p=0.739 n=10+10)

name                            old allocs/op  new allocs/op  delta
Large-12                             335 ± 0%       335 ± 0%    ~     (all equal)
LargeWithExisting-12               9.35k ± 1%     9.33k ± 1%    ~     (p=0.100 n=10+10)
LargeImbalanced-12                   787 ± 3%       794 ± 2%    ~     (p=0.193 n=8+8)
LargeWithExistingImbalanced-12     9.30k ± 1%     9.29k ± 1%    ~     (p=0.470 n=10+10)
Java/large-12                      6.04k ± 0%     6.04k ± 0%    ~     (p=0.294 n=10+8)
Java/large_imbalance-12            7.42k ± 0%     7.43k ± 0%    ~     (p=0.201 n=9+9)
Java/medium-12                     3.03k ± 0%     3.03k ± 0%    ~     (all equal)
Java/medium_imbalance-12           3.15k ± 0%     3.14k ± 0%  -0.11%  (p=0.002 n=10+10)
Java/small-12                      2.46k ± 0%     2.46k ± 0%    ~     (all equal)
Java/small_imbalance-12            2.55k ± 1%     2.55k ± 1%    ~     (p=0.670 n=10+10)
  • Loading branch information
twmb committed May 21, 2022
1 parent 6c0756d commit 4e2fa3f
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 32 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ require (
github.com/klauspost/compress v1.15.2
github.com/pierrec/lz4/v4 v4.1.14
github.com/twmb/franz-go/pkg/kmsg v1.0.0
github.com/twmb/go-rbtree v1.0.0
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ github.com/pierrec/lz4/v4 v4.1.14 h1:+fL8AQEZtz/ijeNnpduH0bROTu0O3NZAlPjQxGn8LwE
github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/twmb/franz-go/pkg/kmsg v1.0.0 h1:dQdaXLDUEb+XkSUqw2/GvMEGdw1o89X2fOiFjlhztyA=
github.com/twmb/franz-go/pkg/kmsg v1.0.0/go.mod h1:SxG/xJKhgPu25SamAq0rrucfp7lbzCpEXOC+vH/ELrY=
github.com/twmb/go-rbtree v1.0.0 h1:KxN7dXJ8XaZ4cvmHV1qqXTshxX3EBvX/toG5+UR49Mg=
github.com/twmb/go-rbtree v1.0.0/go.mod h1:UlIAI8gu3KRPkXSobZnmJfVwCJgEhD/liWzT5ppzIyc=
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f h1:OeJjE6G4dgCY4PIXvIRQbE8+RX+uXZyGhUy/ksMGJoc=
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
Expand Down
Loading

0 comments on commit 4e2fa3f

Please sign in to comment.