Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4388 +/- ##
==========================================
+ Coverage 87.13% 87.16% +0.02%
==========================================
Files 359 359
Lines 39069 39098 +29
==========================================
+ Hits 34044 34078 +34
+ Misses 5018 5013 -5
Partials 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
35dcdd7 to
1a1323a
Compare
7c34b24 to
f1d210f
Compare
f1d210f to
1cc1ead
Compare
176c09d to
765aba9
Compare
6cecd8c to
ccb9268
Compare
f36926b to
8b2b971
Compare
8b2b971 to
b709370
Compare
b709370 to
90c6e33
Compare
| return nil | ||
| } | ||
|
|
||
| func ECDSASecp256r1CheckMultisigDummy(ic *interop.Context) error { |
There was a problem hiding this comment.
As discussed earlier, we won't use this approximation and we're OK with n*checkSigPrice for System.Crypto.CheckMultisig. So let's remove this method.
| @@ -0,0 +1,20 @@ | |||
| package interop_test | |||
There was a problem hiding this comment.
Let's specify the build constraint via comment, like in
neo-go/cli/server/signals_unix.go
Line 1 in ac51380
| } | ||
| err = f.Sync() | ||
| if err == nil { | ||
| err = unix.Fadvise(int(f.Fd()), 0, 0, unix.FADV_DONTNEED) |
There was a problem hiding this comment.
Adjust filename. AFAIK, the same test will properly work on all unix systems.
| } | ||
| err = f.Sync() | ||
| if err == nil { | ||
| err = unix.Fadvise(int(f.Fd()), 0, 0, unix.FADV_DONTNEED) |
There was a problem hiding this comment.
Why not via clearing page cache at OS level?
| b.Fatal(err) | ||
| } | ||
| } | ||
| b.StartTimer() |
There was a problem hiding this comment.
Useless call to b.StartTimer().
| type benchCase struct { | ||
| f func(*interop.Context) error | ||
| itemsToAdd []any | ||
| amountToPop int |
|
|
||
| type benchCase struct { | ||
| f func(*interop.Context) error | ||
| itemsToAdd []any |
There was a problem hiding this comment.
itemsToPush, for unification.
| } | ||
| pubBytes := priv.PublicKey().Bytes() | ||
|
|
||
| measure := func(n int) []string { |
There was a problem hiding this comment.
We're not in Python, use proper type/struct instead of []string.
| return ns / nopNs | ||
| } | ||
|
|
||
| func genCreateMultisigAccount(nopNs float64) [][]string { |
There was a problem hiding this comment.
Ditto, use type instead of [][]string.
| func TestGenerateNOPCSV(t *testing.T) { | ||
| if *genOutDir == "" { | ||
| t.Skip("-genoutdir is not set") | ||
| } |
There was a problem hiding this comment.
It's a benchmark, not test. Create a unit-test that will use static filenames and generate all the output files on some constant boolean condition. Take the approach from TestCreateBasicChain.
| nopIC.SpawnVM() | ||
| nopIC.VM.SetGasLimit(-1) | ||
| nopNs := measureNsPerOp(func(b *testing.B) { benchmarkNOP(b, nopIC) }) | ||
| t.Logf("nop ns/op = %v", nopNs) |
There was a problem hiding this comment.
NOP here and everywhere where the string representation of an opcode is used.
| } | ||
| } | ||
|
|
||
| func readNOPNs(dir string) (float64, error) { |
There was a problem hiding this comment.
Why do you need a separate read for NOPs? Why not to start TestGenerateInteropPriceCSV with NOPs evaluation in-place? It will give more robust data that are relatively independent from the benchmark environment.
There was a problem hiding this comment.
How long does it take to run benchmark for NOP?
| return nopNs, nil | ||
| } | ||
|
|
||
| func TestGenerateInteropPriceCSV(t *testing.T) { |
There was a problem hiding this comment.
Place all gen* functions to a separate file, decouple them from the real benchmark setup.
| go.uber.org/zap v1.28.0 | ||
| go.yaml.in/yaml/v3 v3.0.5 | ||
| golang.org/x/crypto v0.55.0 | ||
| golang.org/x/sys v0.47.0 |
Signed-off-by: Tural Devrishev <tural@nspcc.ru>
90c6e33 to
f7e8c6a
Compare
A part of #4281.