Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cmd/aminoscan): set len=0 in a slice initialization (#2971)
<!-- please provide a detailed description of the changes made in this pull request. --> <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests </details> The intention here should be to initialize a slice with a capacity of `len(args)` rather than initializing the length of this slice. The online demo: https://go.dev/play/p/q1BcVCmvidW
- Loading branch information
b655cd2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Go Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.20
.BenchmarkBinary/EmptyStruct:encode
507.1
ns/op 96 B/op 2 allocs/op289.4
ns/op 96 B/op 2 allocs/op1.75
BenchmarkBinary/EmptyStruct:encode - ns/op
507.1
ns/op289.4
ns/op1.75
BenchmarkBinary/EmptyStruct:decode
290.9
ns/op 0 B/op 0 allocs/op143
ns/op 0 B/op 0 allocs/op2.03
BenchmarkBinary/EmptyStruct:decode - ns/op
290.9
ns/op143
ns/op2.03
BenchmarkBinary/ShortArraysStruct:encode
791.2
ns/op 192 B/op 4 allocs/op623.6
ns/op 192 B/op 4 allocs/op1.27
BenchmarkBinary/ShortArraysStruct:encode - ns/op
791.2
ns/op623.6
ns/op1.27
BenchmarkBinary/ShortArraysStruct:decode
377.6
ns/op 0 B/op 0 allocs/op229.5
ns/op 0 B/op 0 allocs/op1.65
BenchmarkBinary/ShortArraysStruct:decode - ns/op
377.6
ns/op229.5
ns/op1.65
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
63872849
ns/op 5130 B/op 9 allocs/op31986249
ns/op 5125 B/op 9 allocs/op2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
63872849
ns/op31986249
ns/op2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
127533601
ns/op 5139 B/op 9 allocs/op31986249
ns/op 5125 B/op 9 allocs/op3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
127533601
ns/op31986249
ns/op3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
254948507
ns/op 5158 B/op 9 allocs/op31986249
ns/op 5125 B/op 9 allocs/op7.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
254948507
ns/op31986249
ns/op7.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
509821704
ns/op 5196 B/op 10 allocs/op31986249
ns/op 5125 B/op 9 allocs/op15.94
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
509821704
ns/op31986249
ns/op15.94
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
1019502736
ns/op 5736 B/op 15 allocs/op31986249
ns/op 5125 B/op 9 allocs/op31.87
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
1019502736
ns/op31986249
ns/op31.87
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op
15
allocs/op9
allocs/op1.67
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
2039029968
ns/op 5736 B/op 15 allocs/op31986249
ns/op 5125 B/op 9 allocs/op63.75
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
2039029968
ns/op31986249
ns/op63.75
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op
15
allocs/op9
allocs/op1.67
BenchmarkSigning
82686
ns/op 1856 B/op 36 allocs/op25728
ns/op 64 B/op 1 allocs/op3.21
BenchmarkSigning - ns/op
82686
ns/op25728
ns/op3.21
BenchmarkSigning - B/op
1856
B/op64
B/op29
BenchmarkSigning - allocs/op
36
allocs/op1
allocs/op36
BenchmarkSigning
84300
ns/op 1856 B/op 36 allocs/op25728
ns/op 64 B/op 1 allocs/op3.28
BenchmarkSigning - ns/op
84300
ns/op25728
ns/op3.28
BenchmarkSigning - B/op
1856
B/op64
B/op29
BenchmarkSigning - allocs/op
36
allocs/op1
allocs/op36
BenchmarkVerification
172454
ns/op 864 B/op 19 allocs/op61301
ns/op 0 B/op 0 allocs/op2.81
BenchmarkVerification - ns/op
172454
ns/op61301
ns/op2.81
BenchmarkVerification - B/op
864
B/op0
B/op+∞
BenchmarkVerification - allocs/op
19
allocs/op0
allocs/op+∞
BenchmarkVerification
160357
ns/op 864 B/op 19 allocs/op61301
ns/op 0 B/op 0 allocs/op2.62
BenchmarkVerification - ns/op
160357
ns/op61301
ns/op2.62
BenchmarkVerification - B/op
864
B/op0
B/op+∞
BenchmarkVerification - allocs/op
19
allocs/op0
allocs/op+∞
BenchmarkRandomBytes/random
68.45
ns/op 16 B/op 1 allocs/op33.09
ns/op 4 B/op 1 allocs/op2.07
BenchmarkRandomBytes/random - ns/op
68.45
ns/op33.09
ns/op2.07
BenchmarkRandomBytes/random - B/op
16
B/op4
B/op4
BenchmarkRandomBytes/random
104.4
ns/op 32 B/op 1 allocs/op33.09
ns/op 4 B/op 1 allocs/op3.16
BenchmarkRandomBytes/random - ns/op
104.4
ns/op33.09
ns/op3.16
BenchmarkRandomBytes/random - B/op
32
B/op4
B/op8
BenchmarkRandomBytes/random
265
ns/op 112 B/op 1 allocs/op33.09
ns/op 4 B/op 1 allocs/op8.01
BenchmarkRandomBytes/random - ns/op
265
ns/op33.09
ns/op8.01
BenchmarkRandomBytes/random - B/op
112
B/op4
B/op28
BenchmarkRandomBytes/random
2283
ns/op 1024 B/op 1 allocs/op33.09
ns/op 4 B/op 1 allocs/op68.99
BenchmarkRandomBytes/random - ns/op
2283
ns/op33.09
ns/op68.99
BenchmarkRandomBytes/random - B/op
1024
B/op4
B/op256
BenchmarkSmall/boltdb-1000-100-16-40/update
1338258
ns/op 42017 B/op 371 allocs/op997556
ns/op 37335 B/op 373 allocs/op1.34
BenchmarkSmall/boltdb-1000-100-16-40/update - ns/op
1338258
ns/op997556
ns/op1.34
BenchmarkSmall/memdb-1000-100-16-40/block
16745593
ns/op 9163746 B/op 166999 allocs/op13294578
ns/op 6577355 B/op 116750 allocs/op1.26
BenchmarkSmall/memdb-1000-100-16-40/block - ns/op
16745593
ns/op13294578
ns/op1.26
BenchmarkSmall/memdb-1000-100-16-40/block - B/op
9163746
B/op6577355
B/op1.39
BenchmarkSmall/memdb-1000-100-16-40/block - allocs/op
166999
allocs/op116750
allocs/op1.43
BenchmarkMedium/boltdb-100000-100-16-40/update
6917271
ns/op 134547 B/op 1043 allocs/op5417526
ns/op 101670 B/op 859 allocs/op1.28
BenchmarkMedium/boltdb-100000-100-16-40/update - ns/op
6917271
ns/op5417526
ns/op1.28
BenchmarkMedium/boltdb-100000-100-16-40/update - B/op
134547
B/op101670
B/op1.32
BenchmarkMedium/boltdb-100000-100-16-40/update - allocs/op
1043
allocs/op859
allocs/op1.21
BenchmarkMedium/memdb-100000-100-16-40/update
1246634
ns/op 371393 B/op 7356 allocs/op1007055
ns/op 250726 B/op 4829 allocs/op1.24
BenchmarkMedium/memdb-100000-100-16-40/update - ns/op
1246634
ns/op1007055
ns/op1.24
BenchmarkMedium/memdb-100000-100-16-40/update - B/op
371393
B/op250726
B/op1.48
BenchmarkMedium/memdb-100000-100-16-40/update - allocs/op
7356
allocs/op4829
allocs/op1.52
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - B/op
47608
B/op38764
B/op1.23
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - allocs/op
581
allocs/op449
allocs/op1.29
BenchmarkHash/ripemd160
2837
ns/op 25 B/op 1 allocs/op699.2
ns/op 25 B/op 1 allocs/op4.06
BenchmarkHash/ripemd160 - ns/op
2837
ns/op699.2
ns/op4.06
BenchmarkHash/sha2-256
522.6
ns/op 33 B/op 1 allocs/op170.4
ns/op 33 B/op 1 allocs/op3.07
BenchmarkHash/sha2-256 - ns/op
522.6
ns/op170.4
ns/op3.07
BenchmarkHash/sha3-256
1840
ns/op 33 B/op 1 allocs/op714
ns/op 33 B/op 1 allocs/op2.58
BenchmarkHash/sha3-256 - ns/op
1840
ns/op714
ns/op2.58
BenchmarkWriteSecretConnection
5456
ns/op 0 B/op 0 allocs/op4024
ns/op 0 B/op 0 allocs/op1.36
BenchmarkWriteSecretConnection - ns/op
5456
ns/op4024
ns/op1.36
BenchmarkReadSecretConnection
3742
ns/op 0 B/op 0 allocs/op2359
ns/op 0 B/op 0 allocs/op1.59
BenchmarkReadSecretConnection - ns/op
3742
ns/op2359
ns/op1.59
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ajnavarro @thehowl @zivkovicmilos