Skip to content

Commit

Permalink
feat(stdlibs): add package strconv (#1464)
Browse files Browse the repository at this point in the history
This PR adds the full `strconv` package, implemented as pure Gno code.
It removes the native functions `Itoa` (and others), and adds support
for new functions such as `FormatFloat`.

# Summary of changes

- Standard libraries
- Changes of `strconv` from Go stdlib:
https://gist.github.com/thehowl/904b42b1ea53fef9b8a0486155c02b73 --
tldr:
    - removed everything related to complex types.
    - avoid using reflection and dot imports.
- instead of loading testfp.txt, embed the file directly into the
source.
    - define min/max explicitly as they're not built-in yet.
    - remove go:build tags.
    - (all of these mostly involve test files.)
  - `unicode`
    - Update tables, so that `strconv` tests succeed.
  - `unicode/utf8`
- Update to latest go version. Mostly, use `fallback` (as we now
half-support it) and use `AppendString`.
- GnoVM
- PackageInjector is no longer necessary (hallelujah), see #814 for
context. This justifies the changes in `store.go`, `store_test.go`,
`nodes.go`, `tests/imports.go`.
  - `gonative.go` and `machine.go` changes improve some error messages.
- `preprocess.go` changes fix a bug which can be seen in the `for20.gno`
test. If a `for` loop is labeled, then a bare `break` (ie. without a
label to break to) would panic, as it wouldn't find any for loop without
a label (in `findBranchLabel`). I added a regression test as well as a
couple test showing the error message for when we misplace
continue/break statements.
- Tests.
- `strconv.Itoa` now uses more gas than its existing native
implementation. This is to be expected; we can consider moving it back
to a native implementation if we deem it useful for performance, but I
think it's good for us to work on having as much code implemented
directly in gno before moving it back to Go for performance.

---------

Co-authored-by: Manfred Touron <[email protected]>
  • Loading branch information
thehowl and moul authored Oct 17, 2024
1 parent 6d986bf commit 05cd4f5
Show file tree
Hide file tree
Showing 56 changed files with 9,703 additions and 750 deletions.
4 changes: 3 additions & 1 deletion docs/reference/go-gno-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Legend:
| runtime/trace | `gospec` |
| slices | `gnics` |
| sort | `part`[^6] |
| strconv | `part` |
| strconv | `full`[^10] |
| strings | `full` |
| sync | `tbd` |
| sync/atomic | `tbd` |
Expand Down Expand Up @@ -292,6 +292,8 @@ Legend:
[^8]: `crypto/ed25519` is currently only implemented for `Verify`, which should
still cover a majority of use cases. A full implementation is welcome.
[^9]: `math/rand` in Gno ports over Go's `math/rand/v2`.
[^10]: `strconv` does not have the methods relating to types `complex64` and
`complex128`.

## Tooling (`gno` binary)

Expand Down
34 changes: 17 additions & 17 deletions gno.land/cmd/gnoland/testdata/append.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,69 @@ loadpkg gno.land/p/demo/ufmt
# start a new node
gnoland start

gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/append -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/append -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

# Call Append 1
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 2000000 -args '1' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 4000000 -args '1' -broadcast -chainid=tendermint_test test1
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func AppendNil -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func AppendNil -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

# Call Append 2
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 2000000 -args '2' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 4000000 -args '2' -broadcast -chainid=tendermint_test test1
stdout OK!

# Call Append 3
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 2000000 -args '3' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 4000000 -args '3' -broadcast -chainid=tendermint_test test1
stdout OK!

# Call render
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 2000000 -args '' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args '' -broadcast -chainid=tendermint_test test1
stdout '("1-2-3-" string)'
stdout OK!

# Call Pop
gnokey maketx call -pkgpath gno.land/r/append -func Pop -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Pop -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

# Call render
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 2000000 -args '' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args '' -broadcast -chainid=tendermint_test test1
stdout '("2-3-" string)'
stdout OK!

# Call Append 42
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 2000000 -args '42' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Append -gas-fee 1000000ugnot -gas-wanted 4000000 -args '42' -broadcast -chainid=tendermint_test test1
stdout OK!

# Call render
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 2000000 -args '' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args '' -broadcast -chainid=tendermint_test test1
stdout '("2-3-42-" string)'
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func CopyAppend -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func CopyAppend -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func PopB -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func PopB -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

# Call render
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 2000000 -args '' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args '' -broadcast -chainid=tendermint_test test1
stdout '("2-3-42-" string)'
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func AppendMoreAndC -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func AppendMoreAndC -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func ReassignC -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func ReassignC -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 2000000 -args '' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args '' -broadcast -chainid=tendermint_test test1
stdout '("2-3-42-70-100-" string)'
stdout OK!

gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 2000000 -args 'd' -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/append -func Render -gas-fee 1000000ugnot -gas-wanted 4000000 -args 'd' -broadcast -chainid=tendermint_test test1
stdout '("1-" string)'
stdout OK!

Expand Down
40 changes: 20 additions & 20 deletions gno.land/cmd/gnoland/testdata/assertorigincall.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -33,85 +33,85 @@ gnoland start

# Test cases
## 1. MsgCall -> myrlm.A: PANIC
! gnokey maketx call -pkgpath gno.land/r/myrlm -func A -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/myrlm -func A -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'

## 2. MsgCall -> myrlm.B: PASS
gnokey maketx call -pkgpath gno.land/r/myrlm -func B -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/myrlm -func B -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 3. MsgCall -> myrlm.C: PASS
gnokey maketx call -pkgpath gno.land/r/myrlm -func C -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/myrlm -func C -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 4. MsgCall -> r/foo.A -> myrlm.A: PANIC
! gnokey maketx call -pkgpath gno.land/r/foo -func A -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/foo -func A -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'

## 5. MsgCall -> r/foo.B -> myrlm.B: PASS
gnokey maketx call -pkgpath gno.land/r/foo -func B -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/foo -func B -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 6. MsgCall -> r/foo.C -> myrlm.C: PANIC
! gnokey maketx call -pkgpath gno.land/r/foo -func C -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
! gnokey maketx call -pkgpath gno.land/r/foo -func C -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'

## remove due to update to maketx call can only call realm (case 7,8,9)
## 7. MsgCall -> p/demo/bar.A -> myrlm.A: PANIC
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func A -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func A -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
## stderr 'invalid non-origin call'

## 8. MsgCall -> p/demo/bar.B -> myrlm.B: PASS
## gnokey maketx call -pkgpath gno.land/p/demo/bar -func B -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
## gnokey maketx call -pkgpath gno.land/p/demo/bar -func B -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
## stdout 'OK!'

## 9. MsgCall -> p/demo/bar.C -> myrlm.C: PANIC
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func C -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func C -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
## stderr 'invalid non-origin call'

## 10. MsgRun -> run.main -> myrlm.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmA.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmA.gno
stderr 'invalid non-origin call'

## 11. MsgRun -> run.main -> myrlm.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmB.gno
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmB.gno
stdout 'OK!'

## 12. MsgRun -> run.main -> myrlm.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmC.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmC.gno
stderr 'invalid non-origin call'

## 13. MsgRun -> run.main -> foo.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooA.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooA.gno
stderr 'invalid non-origin call'

## 14. MsgRun -> run.main -> foo.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooB.gno
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooB.gno
stdout 'OK!'

## 15. MsgRun -> run.main -> foo.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooC.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/fooC.gno
stderr 'invalid non-origin call'

## 16. MsgRun -> run.main -> bar.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/barA.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/barA.gno
stderr 'invalid non-origin call'

## 17. MsgRun -> run.main -> bar.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/barB.gno
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/barB.gno
stdout 'OK!'

## 18. MsgRun -> run.main -> bar.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/barC.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/barC.gno
stderr 'invalid non-origin call'

## remove testcase 19 due to maketx call forced to call a realm
## 19. MsgCall -> std.AssertOriginCall: pass
## gnokey maketx call -pkgpath std -func AssertOriginCall -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1
## gnokey maketx call -pkgpath std -func AssertOriginCall -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1
## stdout 'OK!'

## 20. MsgRun -> std.AssertOriginCall: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 2000000 -broadcast -chainid tendermint_test test1 $WORK/run/baz.gno
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 4000000 -broadcast -chainid tendermint_test test1 $WORK/run/baz.gno
stderr 'invalid non-origin call'


Expand Down
10 changes: 5 additions & 5 deletions gno.land/cmd/gnoland/testdata/grc20_registry.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ loadpkg gno.land/r/registry $WORK/registry
gnoland start

# we call Transfer with foo20, before it's registered
gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout 'not found'

# add foo20, and foo20wrapper
gnokey maketx addpkg -pkgdir $WORK/foo20 -pkgpath gno.land/r/foo20 -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx addpkg -pkgdir $WORK/foo20wrapper -pkgpath gno.land/r/foo20wrapper -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx addpkg -pkgdir $WORK/foo20 -pkgpath gno.land/r/foo20 -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
gnokey maketx addpkg -pkgdir $WORK/foo20wrapper -pkgpath gno.land/r/foo20wrapper -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1

# we call Transfer with foo20, after it's registered
gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/registry -func TransferByName -args 'foo20' -args 'g123456789' -args '42' -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout 'same address, success!'

-- registry/registry.gno --
Expand Down Expand Up @@ -49,7 +49,7 @@ import "gno.land/r/registry"
import "gno.land/r/foo20"

func init() {
registry.Register("foo20", foo20.Transfer)
registry.Register("foo20", foo20.Transfer)
}

-- foo20/foo20.gno --
Expand Down
12 changes: 6 additions & 6 deletions gno.land/cmd/gnoland/testdata/issue_1167.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ loadpkg gno.land/p/demo/avl
gnoland start

# add contract
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/demo/xx -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/demo/xx -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

# execute New
gnokey maketx call -pkgpath gno.land/r/demo/xx -func New -args X -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/xx -func New -args X -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!

# execute Delta for the first time
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Delta -args X -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Delta -args X -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!
stdout '"1,1,1;" string'

# execute Delta for the second time
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Delta -args X -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Delta -args X -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!
stdout '1,1,1;2,2,2;" string'

# execute Delta for the third time
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Delta -args X -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Delta -args X -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!
stdout '1,1,1;2,2,2;3,3,3;" string'

# execute Render
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Render -args X -gas-fee 1000000ugnot -gas-wanted 2000000 -broadcast -chainid=tendermint_test test1
gnokey maketx call -pkgpath gno.land/r/demo/xx -func Render -args X -gas-fee 1000000ugnot -gas-wanted 4000000 -broadcast -chainid=tendermint_test test1
stdout OK!
stdout '1,1,1;2,2,2;3,3,3;" string'

Expand Down
Loading

1 comment on commit 05cd4f5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

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.

Benchmark suite Current: 05cd4f5 Previous: d63918f Ratio
BenchmarkBinary/EmptyStruct:encode 500.5 ns/op 96 B/op 2 allocs/op 290.9 ns/op 96 B/op 2 allocs/op 1.72
BenchmarkBinary/EmptyStruct:encode - ns/op 500.5 ns/op 290.9 ns/op 1.72
BenchmarkBinary/EmptyStruct:decode 261.2 ns/op 0 B/op 0 allocs/op 143.1 ns/op 0 B/op 0 allocs/op 1.83
BenchmarkBinary/EmptyStruct:decode - ns/op 261.2 ns/op 143.1 ns/op 1.83
BenchmarkBinary/ShortArraysStruct:encode 784.3 ns/op 192 B/op 4 allocs/op 603.7 ns/op 192 B/op 4 allocs/op 1.30
BenchmarkBinary/ShortArraysStruct:encode - ns/op 784.3 ns/op 603.7 ns/op 1.30
BenchmarkBinary/ShortArraysStruct:decode 382.4 ns/op 0 B/op 0 allocs/op 219.5 ns/op 0 B/op 0 allocs/op 1.74
BenchmarkBinary/ShortArraysStruct:decode - ns/op 382.4 ns/op 219.5 ns/op 1.74
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 63903262 ns/op 5130 B/op 9 allocs/op 31935341 ns/op 5125 B/op 9 allocs/op 2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 63903262 ns/op 31935341 ns/op 2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 127549304 ns/op 5139 B/op 9 allocs/op 31935341 ns/op 5125 B/op 9 allocs/op 3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 127549304 ns/op 31935341 ns/op 3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 255057782 ns/op 5158 B/op 9 allocs/op 31935341 ns/op 5125 B/op 9 allocs/op 7.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 255057782 ns/op 31935341 ns/op 7.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 509930160 ns/op 5196 B/op 10 allocs/op 31935341 ns/op 5125 B/op 9 allocs/op 15.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 509930160 ns/op 31935341 ns/op 15.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 1019802927 ns/op 5736 B/op 15 allocs/op 31935341 ns/op 5125 B/op 9 allocs/op 31.93
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 1019802927 ns/op 31935341 ns/op 31.93
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op 15 allocs/op 9 allocs/op 1.67
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 2039904969 ns/op 5736 B/op 15 allocs/op 31935341 ns/op 5125 B/op 9 allocs/op 63.88
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 2039904969 ns/op 31935341 ns/op 63.88
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op 15 allocs/op 9 allocs/op 1.67
BenchmarkSigning 84313 ns/op 1856 B/op 36 allocs/op 25709 ns/op 64 B/op 1 allocs/op 3.28
BenchmarkSigning - ns/op 84313 ns/op 25709 ns/op 3.28
BenchmarkSigning - B/op 1856 B/op 64 B/op 29
BenchmarkSigning - allocs/op 36 allocs/op 1 allocs/op 36
BenchmarkSigning 83375 ns/op 1856 B/op 36 allocs/op 25709 ns/op 64 B/op 1 allocs/op 3.24
BenchmarkSigning - ns/op 83375 ns/op 25709 ns/op 3.24
BenchmarkSigning - B/op 1856 B/op 64 B/op 29
BenchmarkSigning - allocs/op 36 allocs/op 1 allocs/op 36
BenchmarkVerification 166793 ns/op 864 B/op 19 allocs/op 61140 ns/op 0 B/op 0 allocs/op 2.73
BenchmarkVerification - ns/op 166793 ns/op 61140 ns/op 2.73
BenchmarkVerification - B/op 864 B/op 0 B/op +∞
BenchmarkVerification - allocs/op 19 allocs/op 0 allocs/op +∞
BenchmarkVerification 165400 ns/op 864 B/op 19 allocs/op 61140 ns/op 0 B/op 0 allocs/op 2.71
BenchmarkVerification - ns/op 165400 ns/op 61140 ns/op 2.71
BenchmarkVerification - B/op 864 B/op 0 B/op +∞
BenchmarkVerification - allocs/op 19 allocs/op 0 allocs/op +∞
BenchmarkBoltDBRandomReadsWrites 1779256 ns/op 24574 B/op 63 allocs/op 1432256 ns/op 25633 B/op 64 allocs/op 1.24
BenchmarkBoltDBRandomReadsWrites - ns/op 1779256 ns/op 1432256 ns/op 1.24
BenchmarkRandomBytes/random 68.59 ns/op 16 B/op 1 allocs/op 32.1 ns/op 4 B/op 1 allocs/op 2.14
BenchmarkRandomBytes/random - ns/op 68.59 ns/op 32.1 ns/op 2.14
BenchmarkRandomBytes/random - B/op 16 B/op 4 B/op 4
BenchmarkRandomBytes/random 105.8 ns/op 32 B/op 1 allocs/op 32.1 ns/op 4 B/op 1 allocs/op 3.30
BenchmarkRandomBytes/random - ns/op 105.8 ns/op 32.1 ns/op 3.30
BenchmarkRandomBytes/random - B/op 32 B/op 4 B/op 8
BenchmarkRandomBytes/random 268.8 ns/op 112 B/op 1 allocs/op 32.1 ns/op 4 B/op 1 allocs/op 8.37
BenchmarkRandomBytes/random - ns/op 268.8 ns/op 32.1 ns/op 8.37
BenchmarkRandomBytes/random - B/op 112 B/op 4 B/op 28
BenchmarkRandomBytes/random 2309 ns/op 1024 B/op 1 allocs/op 32.1 ns/op 4 B/op 1 allocs/op 71.93
BenchmarkRandomBytes/random - ns/op 2309 ns/op 32.1 ns/op 71.93
BenchmarkRandomBytes/random - B/op 1024 B/op 4 B/op 256
BenchmarkSmall/boltdb-1000-100-16-40/update 1436734 ns/op 43930 B/op 393 allocs/op 990860 ns/op 37941 B/op 376 allocs/op 1.45
BenchmarkSmall/boltdb-1000-100-16-40/update - ns/op 1436734 ns/op 990860 ns/op 1.45
BenchmarkSmall/memdb-1000-100-16-40/update 82517 ns/op 47156 B/op 823 allocs/op 65775 ns/op 47028 B/op 822 allocs/op 1.25
BenchmarkSmall/memdb-1000-100-16-40/update - ns/op 82517 ns/op 65775 ns/op 1.25
BenchmarkMedium/boltdb-100000-100-16-40/query-miss 10817 ns/op 1208 B/op 33 allocs/op 7909 ns/op 1209 B/op 33 allocs/op 1.37
BenchmarkMedium/boltdb-100000-100-16-40/query-miss - ns/op 10817 ns/op 7909 ns/op 1.37
BenchmarkMedium/boltdb-100000-100-16-40/query-hits 14124 ns/op 1707 B/op 46 allocs/op 10599 ns/op 1704 B/op 46 allocs/op 1.33
BenchmarkMedium/boltdb-100000-100-16-40/query-hits - ns/op 14124 ns/op 10599 ns/op 1.33
BenchmarkMedium/boltdb-100000-100-16-40/update 6844966 ns/op 127307 B/op 991 allocs/op 5020996 ns/op 96953 B/op 821 allocs/op 1.36
BenchmarkMedium/boltdb-100000-100-16-40/update - ns/op 6844966 ns/op 5020996 ns/op 1.36
BenchmarkMedium/boltdb-100000-100-16-40/update - B/op 127307 B/op 96953 B/op 1.31
BenchmarkMedium/boltdb-100000-100-16-40/update - allocs/op 991 allocs/op 821 allocs/op 1.21
BenchmarkMedium/goleveldb-100000-100-16-40/query-miss 14504 ns/op 1539 B/op 28 allocs/op 11085 ns/op 1521 B/op 27 allocs/op 1.31
BenchmarkMedium/goleveldb-100000-100-16-40/query-miss - ns/op 14504 ns/op 11085 ns/op 1.31
BenchmarkMedium/goleveldb-100000-100-16-40/query-hits 19478 ns/op 2163 B/op 38 allocs/op 14974 ns/op 2153 B/op 38 allocs/op 1.30
BenchmarkMedium/goleveldb-100000-100-16-40/query-hits - ns/op 19478 ns/op 14974 ns/op 1.30
BenchmarkMedium/memdb-100000-100-16-40/query-miss 6505 ns/op 406 B/op 7 allocs/op 4276 ns/op 405 B/op 7 allocs/op 1.52
BenchmarkMedium/memdb-100000-100-16-40/query-miss - ns/op 6505 ns/op 4276 ns/op 1.52
BenchmarkMedium/memdb-100000-100-16-40/query-miss 6063 ns/op 403 B/op 7 allocs/op 4276 ns/op 405 B/op 7 allocs/op 1.42
BenchmarkMedium/memdb-100000-100-16-40/query-miss - ns/op 6063 ns/op 4276 ns/op 1.42
BenchmarkMedium/memdb-100000-100-16-40/query-hits 7482 ns/op 559 B/op 9 allocs/op 4776 ns/op 557 B/op 9 allocs/op 1.57
BenchmarkMedium/memdb-100000-100-16-40/query-hits - ns/op 7482 ns/op 4776 ns/op 1.57
BenchmarkMedium/memdb-100000-100-16-40/query-hits 6716 ns/op 558 B/op 9 allocs/op 4776 ns/op 557 B/op 9 allocs/op 1.41
BenchmarkMedium/memdb-100000-100-16-40/query-hits - ns/op 6716 ns/op 4776 ns/op 1.41
BenchmarkMedium/memdb-100000-100-16-40/update 1060276 ns/op 266543 B/op 5154 allocs/op 700651 ns/op 293265 B/op 5716 allocs/op 1.51
BenchmarkMedium/memdb-100000-100-16-40/update - ns/op 1060276 ns/op 700651 ns/op 1.51
BenchmarkMedium/memdb-100000-100-16-40/update 1200896 ns/op 361410 B/op 7160 allocs/op 700651 ns/op 293265 B/op 5716 allocs/op 1.71
BenchmarkMedium/memdb-100000-100-16-40/update - ns/op 1200896 ns/op 700651 ns/op 1.71
BenchmarkMedium/memdb-100000-100-16-40/update - B/op 361410 B/op 293265 B/op 1.23
BenchmarkMedium/memdb-100000-100-16-40/update - allocs/op 7160 allocs/op 5716 allocs/op 1.25
BenchmarkMedium/memdb-100000-100-16-40/block 158964250 ns/op 39887841 B/op 790348 allocs/op 102351078 ns/op 39923744 B/op 790554 allocs/op 1.55
BenchmarkMedium/memdb-100000-100-16-40/block - ns/op 158964250 ns/op 102351078 ns/op 1.55
BenchmarkMedium/memdb-100000-100-16-40/block 132044184 ns/op 39860030 B/op 790134 allocs/op 102351078 ns/op 39923744 B/op 790554 allocs/op 1.29
BenchmarkMedium/memdb-100000-100-16-40/block - ns/op 132044184 ns/op 102351078 ns/op 1.29
BenchmarkLevelDBBatchSizes/goleveldb-100000-5-16-40/query-miss 14556 ns/op 1529 B/op 27 allocs/op 11139 ns/op 1521 B/op 27 allocs/op 1.31
BenchmarkLevelDBBatchSizes/goleveldb-100000-5-16-40/query-miss - ns/op 14556 ns/op 11139 ns/op 1.31
BenchmarkLevelDBBatchSizes/goleveldb-100000-5-16-40/query-hits 19448 ns/op 2140 B/op 38 allocs/op 15070 ns/op 2143 B/op 38 allocs/op 1.29
BenchmarkLevelDBBatchSizes/goleveldb-100000-5-16-40/query-hits - ns/op 19448 ns/op 15070 ns/op 1.29
BenchmarkLevelDBBatchSizes/goleveldb-100000-5-16-40/block 2655735 ns/op 417475 B/op 4115 allocs/op 2181081 ns/op 402987 B/op 4146 allocs/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-5-16-40/block - ns/op 2655735 ns/op 2181081 ns/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/query-miss 14914 ns/op 1525 B/op 27 allocs/op 10993 ns/op 1518 B/op 27 allocs/op 1.36
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/query-miss - ns/op 14914 ns/op 10993 ns/op 1.36
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/query-miss 13522 ns/op 1520 B/op 27 allocs/op 10993 ns/op 1518 B/op 27 allocs/op 1.23
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/query-miss - ns/op 13522 ns/op 10993 ns/op 1.23
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/query-hits 19141 ns/op 2152 B/op 38 allocs/op 14084 ns/op 2146 B/op 38 allocs/op 1.36
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/query-hits - ns/op 19141 ns/op 14084 ns/op 1.36
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/update 354446 ns/op 59025 B/op 636 allocs/op 288685 ns/op 58547 B/op 637 allocs/op 1.23
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/update - ns/op 354446 ns/op 288685 ns/op 1.23
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/block 10093850 ns/op 1424009 B/op 17620 allocs/op 8250470 ns/op 1440852 B/op 17823 allocs/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-25-16-40/block - ns/op 10093850 ns/op 8250470 ns/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-miss 14200 ns/op 1515 B/op 27 allocs/op 10689 ns/op 1528 B/op 27 allocs/op 1.33
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-miss - ns/op 14200 ns/op 10689 ns/op 1.33
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-miss 13346 ns/op 1505 B/op 27 allocs/op 10689 ns/op 1528 B/op 27 allocs/op 1.25
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-miss - ns/op 13346 ns/op 10689 ns/op 1.25
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-hits 18370 ns/op 2151 B/op 38 allocs/op 14108 ns/op 2142 B/op 38 allocs/op 1.30
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-hits - ns/op 18370 ns/op 14108 ns/op 1.30
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-hits 17253 ns/op 2156 B/op 38 allocs/op 14108 ns/op 2142 B/op 38 allocs/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/query-hits - ns/op 17253 ns/op 14108 ns/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/update 279091 ns/op 48003 B/op 554 allocs/op 228712 ns/op 47583 B/op 547 allocs/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-100-16-40/update - ns/op 279091 ns/op 228712 ns/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/query-miss 14194 ns/op 1536 B/op 28 allocs/op 10270 ns/op 1510 B/op 27 allocs/op 1.38
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/query-miss - ns/op 14194 ns/op 10270 ns/op 1.38
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/query-hits 17801 ns/op 2169 B/op 38 allocs/op 13229 ns/op 2145 B/op 38 allocs/op 1.35
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/query-hits - ns/op 17801 ns/op 13229 ns/op 1.35
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/query-hits 16123 ns/op 2159 B/op 38 allocs/op 13229 ns/op 2145 B/op 38 allocs/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/query-hits - ns/op 16123 ns/op 13229 ns/op 1.22
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - B/op 48270 B/op 38841 B/op 1.24
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - allocs/op 575 allocs/op 455 allocs/op 1.26
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/query-miss 13807 ns/op 1502 B/op 27 allocs/op 10224 ns/op 1511 B/op 27 allocs/op 1.35
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/query-miss - ns/op 13807 ns/op 10224 ns/op 1.35
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/query-miss 13097 ns/op 1517 B/op 27 allocs/op 10224 ns/op 1511 B/op 27 allocs/op 1.28
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/query-miss - ns/op 13097 ns/op 10224 ns/op 1.28
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/query-hits 18586 ns/op 2151 B/op 38 allocs/op 13463 ns/op 2145 B/op 38 allocs/op 1.38
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/query-hits - ns/op 18586 ns/op 13463 ns/op 1.38
BenchmarkHash/ripemd160 2827 ns/op 25 B/op 1 allocs/op 694 ns/op 25 B/op 1 allocs/op 4.07
BenchmarkHash/ripemd160 - ns/op 2827 ns/op 694 ns/op 4.07
BenchmarkHash/sha2-256 524.3 ns/op 33 B/op 1 allocs/op 157.2 ns/op 33 B/op 1 allocs/op 3.34
BenchmarkHash/sha2-256 - ns/op 524.3 ns/op 157.2 ns/op 3.34
BenchmarkHash/sha3-256 1847 ns/op 33 B/op 1 allocs/op 687 ns/op 33 B/op 1 allocs/op 2.69
BenchmarkHash/sha3-256 - ns/op 1847 ns/op 687 ns/op 2.69
BenchmarkWriteSecretConnection 6769 ns/op 0 B/op 0 allocs/op 4092 ns/op 0 B/op 0 allocs/op 1.65
BenchmarkWriteSecretConnection - ns/op 6769 ns/op 4092 ns/op 1.65
BenchmarkReadSecretConnection 3728 ns/op 0 B/op 0 allocs/op 2354 ns/op 0 B/op 0 allocs/op 1.58
BenchmarkReadSecretConnection - ns/op 3728 ns/op 2354 ns/op 1.58
BenchmarkAccountMapperSetAccount 22859 ns/op 10672 B/op 141 allocs/op 17392 ns/op 10895 B/op 143 allocs/op 1.31
BenchmarkAccountMapperSetAccount - ns/op 22859 ns/op 17392 ns/op 1.31
BenchmarkAccountMapperSetAccountWithCoins 25590 ns/op 11493 B/op 186 allocs/op 19753 ns/op 11654 B/op 188 allocs/op 1.30
BenchmarkAccountMapperSetAccountWithCoins - ns/op 25590 ns/op 19753 ns/op 1.30
BenchmarkCacheStoreIterator50000 9111756 ns/op 2400676 B/op 4082 allocs/op 6301427 ns/op 2302702 B/op 2358 allocs/op 1.45
BenchmarkCacheStoreIterator50000 - ns/op 9111756 ns/op 6301427 ns/op 1.45
BenchmarkCacheStoreIterator50000 - allocs/op 4082 allocs/op 2358 allocs/op 1.73
BenchmarkCacheStoreIterator100000 26105501 ns/op 5791482 B/op 22732 allocs/op 16418542 ns/op 5332282 B/op 14679 allocs/op 1.59
BenchmarkCacheStoreIterator100000 - ns/op 26105501 ns/op 16418542 ns/op 1.59
BenchmarkCacheStoreIterator100000 - allocs/op 22732 allocs/op 14679 allocs/op 1.55
BenchmarkCacheStoreIterator100000 24336600 ns/op 5701823 B/op 21152 allocs/op 16418542 ns/op 5332282 B/op 14679 allocs/op 1.48
BenchmarkCacheStoreIterator100000 - ns/op 24336600 ns/op 16418542 ns/op 1.48
BenchmarkCacheStoreIterator100000 - allocs/op 21152 allocs/op 14679 allocs/op 1.44
BenchmarkCacheStoreGetNoKeyFound 746.8 ns/op 179 B/op 3 allocs/op 573.1 ns/op 148 B/op 3 allocs/op 1.30
BenchmarkCacheStoreGetNoKeyFound - ns/op 746.8 ns/op 573.1 ns/op 1.30
BenchmarkCacheStoreGetNoKeyFound - B/op 179 B/op 148 B/op 1.21

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ajnavarro @thehowl @zivkovicmilos

Please sign in to comment.