Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add performance benchmarks #47

Closed
wants to merge 1 commit into from
Closed

Conversation

dmvolod
Copy link
Contributor

@dmvolod dmvolod commented Apr 19, 2023

Issue #, if available:

Description of changes:
Added performance benchmarks iniside fields and host functions tests

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: Dmitry Volodin <dmvolod@gmail.com>
@codefromthecrypt
Copy link
Collaborator

merged in #48 I think

@codefromthecrypt
Copy link
Collaborator

here's me using these to test before/after wazero update

# from before 1.0.2 commit
$ go test -run='^$' -bench '^Benchmark.*' ./tests/host-functions ./tests/fields -count 6 > old.txt
# from 1.0.2 commit
$ go test -run='^$' -bench '^Benchmark.*' ./tests/host-functions ./tests/fields -count 6 > new.txt
benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/knqyf263/go-plugin/tests/fields
          │   old.txt   │           new.txt            │
          │   sec/op    │   sec/op     vs base         │
Fields-12   11.20µ ± 2%   11.11µ ± 3%  ~ (p=0.818 n=6)

          │   old.txt    │             new.txt             │
          │     B/op     │     B/op      vs base           │
Fields-12   1.398Ki ± 0%   1.398Ki ± 0%  ~ (p=1.000 n=6) ¹
¹ all samples are equal

          │  old.txt   │            new.txt            │
          │ allocs/op  │ allocs/op   vs base           │
Fields-12   24.00 ± 0%   24.00 ± 0%  ~ (p=1.000 n=6) ¹
¹ all samples are equal

pkg: github.com/knqyf263/go-plugin/tests/host-functions
                 │   old.txt   │           new.txt            │
                 │   sec/op    │   sec/op     vs base         │
HostFunctions-12   8.551µ ± 4%   8.774µ ± 3%  ~ (p=0.240 n=6)

                 │   old.txt    │              new.txt               │
                 │     B/op     │     B/op      vs base              │
HostFunctions-12   5.696Ki ± 0%   5.763Ki ± 0%  +1.17% (p=0.002 n=6)

                 │  old.txt   │            new.txt            │
                 │ allocs/op  │ allocs/op   vs base           │
HostFunctions-12   25.00 ± 0%   25.00 ± 0%  ~ (p=1.000 n=6) ¹
¹ all samples are equal

looks like we are using a little more memory for the HostFunctions bench in 1.0.2. Not something we need to hunt down, but anyway glad we can see things like this now! good job

@dmvolod
Copy link
Contributor Author

dmvolod commented Apr 20, 2023

merged in #48 I think

Yes, sure. Thanks for review and merge. Will close this PR.

@dmvolod dmvolod closed this Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants