Closed qmuntal closed 2 years ago
I've found something good: noescapeCtx
is not necessary because we are passing OpenSSL C pointers as uintptr
instead of unsafe.Pointer
, and the former are already safely hidden from the escape analysis.
So there are only three remaining usages of noescape
, but we can't avoid them because they work on Go pointers.
This PR contains two performance improvements which landed into
dev.boringbranch
during this development cycle, both committed in https://go-review.googlesource.com/c/go/+/395876/11.NewSha1
and friends, as these functions return a pointer which normally escapes in the caller side.The benchmarks demonstrates that the new code does not allocate:
Removing the SHA allocations is important for when openssl is integrated into go1.19, else we would have to disable a new test that checks boring SHAs don't allocate.