mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
benchmarks: smaller tweaks
The crypto benchmark was allocating Bytes() in the b.Loop(), and there's no need for that. The semver benchmark had some duplicate fixtures. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
This commit is contained in:
committed by
Stephan Renatus
parent
6f52916ab1
commit
7750005131
@@ -36,9 +36,9 @@ func TestConstantTimeByteCompare(t *testing.T) {
|
||||
}
|
||||
|
||||
func BenchmarkConstantTimeCompare(b *testing.B) {
|
||||
x, y := big.NewInt(1023), big.NewInt(1024)
|
||||
x, y := big.NewInt(1023).Bytes(), big.NewInt(1024).Bytes()
|
||||
for b.Loop() {
|
||||
_, _ = ConstantTimeByteCompare(x.Bytes(), y.Bytes())
|
||||
_, _ = ConstantTimeByteCompare(x, y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,18 +33,6 @@ type (
|
||||
|
||||
var (
|
||||
fixtures = []fixture{
|
||||
{"0.0.0", "0.0.0-foo"},
|
||||
{"0.0.1", "0.0.0"},
|
||||
{"1.0.0", "0.9.9"},
|
||||
{"0.10.0", "0.9.0"},
|
||||
{"0.99.0", "0.10.0"},
|
||||
{"2.0.0", "1.2.3"},
|
||||
{"0.0.0", "0.0.0-foo"},
|
||||
{"0.0.1", "0.0.0"},
|
||||
{"1.0.0", "0.9.9"},
|
||||
{"0.10.0", "0.9.0"},
|
||||
{"0.99.0", "0.10.0"},
|
||||
{"2.0.0", "1.2.3"},
|
||||
{"0.0.0", "0.0.0-foo"},
|
||||
{"0.0.1", "0.0.0"},
|
||||
{"1.0.0", "0.9.9"},
|
||||
|
||||
Reference in New Issue
Block a user