From fd985d23dcc792354c4d60108dc01f992f4bdbc2 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Wed, 21 Aug 2024 09:30:14 +0000 Subject: crypto/x509,math/rand/v2: implement the encoding.(Binary|Text)Appender MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement the encoding.(Binary|Text)Appender interfaces for "x509.OID". Implement the encoding.BinaryAppender interface for "rand/v2.PCG" and "rand/v2.ChaCha8". "rand/v2.ChaCha8.MarshalBinary" alse gains some performance benefits: │ old │ new │ │ sec/op │ sec/op vs base │ ChaCha8MarshalBinary-8 33.730n ± 2% 9.786n ± 1% -70.99% (p=0.000 n=10) ChaCha8MarshalBinaryRead-8 99.86n ± 1% 17.79n ± 0% -82.18% (p=0.000 n=10) geomean 58.04n 13.19n -77.27% │ old │ new │ │ B/op │ B/op vs base │ ChaCha8MarshalBinary-8 48.00 ± 0% 0.00 ± 0% -100.00% (p=0.000 n=10) ChaCha8MarshalBinaryRead-8 83.00 ± 0% 0.00 ± 0% -100.00% (p=0.000 n=10) │ old │ new │ │ allocs/op │ allocs/op vs base │ ChaCha8MarshalBinary-8 1.000 ± 0% 0.000 ± 0% -100.00% (p=0.000 n=10) ChaCha8MarshalBinaryRead-8 2.000 ± 0% 0.000 ± 0% -100.00% (p=0.000 n=10) For #62384 Change-Id: I604bde6dad90a916012909c7260f4bb06dcf5c0a GitHub-Last-Rev: 78abf9c5dfb74838985637798bcd5cb957541d20 GitHub-Pull-Request: golang/go#68987 Reviewed-on: https://go-review.googlesource.com/c/go/+/607079 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- api/next/62384.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'api') diff --git a/api/next/62384.txt b/api/next/62384.txt index 0c6053d2a0..3a50a2792a 100644 --- a/api/next/62384.txt +++ b/api/next/62384.txt @@ -11,3 +11,7 @@ pkg math/big, method (*Rat) AppendText([]uint8) ([]uint8, error) #62384 pkg regexp, method (*Regexp) AppendText([]uint8) ([]uint8, error) #62384 pkg time, method (Time) AppendBinary([]uint8) ([]uint8, error) #62384 pkg time, method (Time) AppendText([]uint8) ([]uint8, error) #62384 +pkg math/rand/v2, method (*ChaCha8) AppendBinary([]uint8) ([]uint8, error) #62384 +pkg math/rand/v2, method (*PCG) AppendBinary([]uint8) ([]uint8, error) #62384 +pkg crypto/x509, method (OID) AppendBinary([]uint8) ([]uint8, error) #62384 +pkg crypto/x509, method (OID) AppendText([]uint8) ([]uint8, error) #62384 -- cgit v1.3