Skip to content

Commit 3eae9a4

Browse files
committed
increase batchsize
1 parent f5e29a4 commit 3eae9a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

operation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
const secparts = 10
1111
const interval = time.Second / secparts
12+
const batchsize = 4096
1213

1314
type Operation struct {
1415
Limit atomic.Int32 // bandwith limit in bytes/sec
@@ -37,7 +38,7 @@ func (op *Operation) run(ctx context.Context, ch chan<- struct{}) {
3738
for {
3839
if limit := op.Limit.Load(); limit > 0 {
3940
todo := max(1, limit/secparts)
40-
batch := min(1024, todo)
41+
batch := min(batchsize, todo)
4142
op.batch.Store(batch)
4243
drive:
4344
for {

0 commit comments

Comments
 (0)