From a3f5a8492a8bc62d8e2a639bd449b425efa66ce2 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 3 Sep 2021 16:44:13 +0200 Subject: stupidgcm: batch C calls in chacha20poly1305_seal Go has a high overhead for each C call, so batch all openssl operations in the new C function chacha20poly1305_seal. Benchmark results: internal/speed$ go test -bench BenchmarkStupidXchacha -count 10 > old.txt internal/speed$ go test -bench BenchmarkStupidXchacha -count 10 > new.txt internal/speed$ benchstat old.txt new.txt name old time/op new time/op delta StupidXchacha-4 8.79µs ± 1% 7.25µs ± 1% -17.54% (p=0.000 n=10+10) name old speed new speed delta StupidXchacha-4 466MB/s ± 1% 565MB/s ± 1% +21.27% (p=0.000 n=10+10) --- internal/stupidgcm/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 internal/stupidgcm/.gitignore (limited to 'internal/stupidgcm/.gitignore') diff --git a/internal/stupidgcm/.gitignore b/internal/stupidgcm/.gitignore new file mode 100644 index 0000000..5761abc --- /dev/null +++ b/internal/stupidgcm/.gitignore @@ -0,0 +1 @@ +*.o -- cgit v1.2.3