From 2d0ba24ecab375f276f024bc014faad9a7ef169c Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 14 Sep 2021 18:47:41 +0200 Subject: -speed: print cpu model When somebody posts "gocryptfs -speed" results, they are most helpful together with the CPU model. Add the cpu model to the output. Example: $ ./gocryptfs -speed gocryptfs v2.2.0-beta1-5-g52b0444-dirty; go-fuse v2.1.1-0.20210825171523-3ab5d95a30ae; 2021-09-14 go1.17.1 linux/amd64 cpu: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz; with AES acceleration AES-GCM-256-OpenSSL 862.79 MB/s AES-GCM-256-Go 997.71 MB/s (selected in auto mode) AES-SIV-512-Go 159.58 MB/s XChaCha20-Poly1305-OpenSSL 729.65 MB/s XChaCha20-Poly1305-Go 843.97 MB/s (selected in auto mode) --- internal/speed/speed.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/speed/speed.go') diff --git a/internal/speed/speed.go b/internal/speed/speed.go index 231a982..0b1a51a 100644 --- a/internal/speed/speed.go +++ b/internal/speed/speed.go @@ -27,6 +27,16 @@ const blockSize = 4096 // Run - run the speed the test and print the results. func Run() { + cpu := cpuModelName() + if cpu == "" { + cpu = "unknown" + } + aes := "; no AES acceleration" + if stupidgcm.CpuHasAES() { + aes = "; with AES acceleration" + } + fmt.Printf("cpu: %s%s\n", cpu, aes) + bTable := []struct { name string f func(*testing.B) -- cgit v1.2.3