From 19f6422e005ed3f4b1a9f6850d382519673a3c87 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 19 Oct 2020 11:09:10 +0200 Subject: internal/bytealg: add assembly implementation of Count/CountString for riscv64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simple single-byte loop count for now, to be further improved in future CLs. Benchmark on linux/riscv64 (HiFive Unleashed): name old time/op new time/op delta CountSingle/10-4 190ns ± 1% 145ns ± 1% -23.66% (p=0.000 n=10+9) CountSingle/32-4 422ns ± 1% 268ns ± 0% -36.43% (p=0.000 n=10+7) CountSingle/4K-4 43.3µs ± 0% 23.8µs ± 0% -45.09% (p=0.000 n=8+10) CountSingle/4M-4 54.2ms ± 1% 33.3ms ± 1% -38.48% (p=0.000 n=10+10) CountSingle/64M-4 1.52s ± 1% 1.20s ± 1% -21.20% (p=0.000 n=9+9) name old speed new speed delta CountSingle/10-4 52.7MB/s ± 1% 69.1MB/s ± 1% +31.03% (p=0.000 n=10+9) CountSingle/32-4 75.9MB/s ± 1% 119.5MB/s ± 0% +57.34% (p=0.000 n=10+8) CountSingle/4K-4 94.6MB/s ± 0% 172.2MB/s ± 0% +82.10% (p=0.000 n=8+10) CountSingle/4M-4 77.4MB/s ± 1% 125.8MB/s ± 1% +62.54% (p=0.000 n=10+10) CountSingle/64M-4 44.2MB/s ± 1% 56.1MB/s ± 1% +26.91% (p=0.000 n=9+9) Change-Id: I2a6bd50d22d5f598517bb3c5a50066c54280cac5 Reviewed-on: https://go-review.googlesource.com/c/go/+/263541 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Cherry Zhang Reviewed-by: Joel Sing --- src/internal/bytealg/count_native.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/internal/bytealg/count_native.go') diff --git a/src/internal/bytealg/count_native.go b/src/internal/bytealg/count_native.go index 0448fca9e8..b1ff1d265a 100644 --- a/src/internal/bytealg/count_native.go +++ b/src/internal/bytealg/count_native.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build amd64 arm arm64 ppc64le ppc64 s390x +// +build amd64 arm arm64 ppc64le ppc64 riscv64 s390x package bytealg -- cgit v1.3