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

Wrap multi-return APIs using structs: avoid heap escape #131

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

dagood
Copy link
Collaborator

@dagood dagood commented Nov 8, 2023

goos: linux
goarch: amd64
pkg: github.com/golang-fips/openssl/v2
cpu: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
       │   old.txt   │        new-struct.txt        │
       │   sec/op    │   sec/op     vs base         │
ECDH-8   104.1µ ± 3%   103.8µ ± 2%  ~ (p=0.878 n=8)

       │  old.txt   │          new-struct.txt           │
       │    B/op    │    B/op     vs base               │
ECDH-8   40.00 ± 0%   32.00 ± 0%  -20.00% (p=0.000 n=8)

       │  old.txt   │          new-struct.txt           │
       │ allocs/op  │ allocs/op   vs base               │
ECDH-8   2.000 ± 0%   1.000 ± 0%  -50.00% (p=0.000 n=8)

goopenssl.h Outdated Show resolved Hide resolved
Copy link
Contributor

@derekparker derekparker left a comment

Choose a reason for hiding this comment

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

lgtm

@qmuntal qmuntal merged commit 98604fd into v2 Jan 11, 2024
16 checks passed
@qmuntal qmuntal deleted the dev/dagood/heap-avoidance-direct-wrappers branch January 11, 2024 09:43
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.

5 participants