Skip to content

Commit 9835368

Browse files
committed
reduce 20bytes/op on drainer
1 parent d8f6a98 commit 9835368

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ goos: linux, goarch: amd64, cpu: 13th Gen Intel i9-13900KS
179179
|------------------------------------|------------:|--------:|------:|-----------:|
180180
| **ErrGroup** | 6,203,892 | **183.5** | **24** | **1** |
181181
| **GoPool** | 6,145,203 | **192.0** | 32 | 1 |
182-
| GoPoolWithDrainer | 5,508,412 | 209.0 | 127 | 2 |
182+
| GoPoolWithDrainer | 5,508,412 | 205.4 | 102 | 2 |
183183
| ChannelsWithOutputAndErrChannel | 4,461,849 | 262.0 | 72 | 2 |
184184
| ChannelsWithWaitGroup | 4,431,901 | 271.8 | 80 | 2 |
185185
| ChannelsWithErrGroup | 4,459,243 | 274.8 | 80 | 2 |

benchmark_chart_v2.png

-1.68 KB
Loading

drain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"sync/atomic"
55
)
66

7-
const chunkSize = 2048
7+
const chunkSize = 256
88

99
type chunk[T any] struct {
1010
items [chunkSize]T

0 commit comments

Comments
 (0)