aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/alg.c
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2014-02-06 17:43:22 -0800
committerKeith Randall <khr@golang.org>2014-02-06 17:43:22 -0800
commitda7cf0ba5d5aed78f07c82508f0fa88e6dd69ea7 (patch)
tree53946fc6bf0ab051d12b2804bc2d4dcb48fb401d /src/pkg/runtime/alg.c
parentaac872e11806b7a66ab51f5efab7496a36e4f3da (diff)
downloadgo-da7cf0ba5d5aed78f07c82508f0fa88e6dd69ea7.tar.xz
runtime: faster memclr on x86.
Use explicit SSE writes instead of REP STOSQ. benchmark old ns/op new ns/op delta BenchmarkMemclr5 22 5 -73.62% BenchmarkMemclr16 27 5 -78.49% BenchmarkMemclr64 28 6 -76.43% BenchmarkMemclr256 34 8 -74.94% BenchmarkMemclr4096 112 84 -24.73% BenchmarkMemclr65536 1902 1920 +0.95% LGTM=dvyukov R=golang-codereviews, dvyukov CC=golang-codereviews https://golang.org/cl/60090044
Diffstat (limited to 'src/pkg/runtime/alg.c')
-rw-r--r--src/pkg/runtime/alg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/runtime/alg.c b/src/pkg/runtime/alg.c
index c3a8396955..623858f7c1 100644
--- a/src/pkg/runtime/alg.c
+++ b/src/pkg/runtime/alg.c
@@ -514,6 +514,11 @@ runtime·equal(Type *t, ...)
t->alg->equal((bool*)ret, t->size, x, y);
}
+// Testing adapter for memclr
+void runtime·memclrBytes(Slice s) {
+ runtime·memclr(s.array, s.len);
+}
+
// Testing adapters for hash quality tests (see hash_test.go)
void runtime·haveGoodHash(bool res) {
res = use_aeshash;