Commit b9ffff4dff32ed4b8548f67e63251614c80f1e32

Parents: 6da5b2a6263934ef47a145a71de21fce4d5517de

From: Moritz Poldrack <ich@moritz-poldrack.de>
Date: Wed May 19 00:47:39 2021 +0700

added simd patch

		

Stats

testdata/benchmarks/data-throughput/patches/simd.patch +37/-0

Changeset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
diff --git a/testdata/benchmarks/data-throughput/patches/simd.patch b/testdata/benchmarks/data-throughput/patches/simd.patch
new file mode 100644
index 0000000000000000000000000000000000000000..aead3f3b8f4a3ec8bc9494ba5ab5b8084a826602
--- /dev/null
+++ b/testdata/benchmarks/data-throughput/patches/simd.patch
@@ -0,0 +1,37 @@
+diff --git a/testdata/benchmarks/data-throughput/main.go b/testdata/benchmarks/data-throughput/main.go
+index bdedaec..f896818 100644
+--- a/testdata/benchmarks/data-throughput/main.go
++++ b/testdata/benchmarks/data-throughput/main.go
+@@ -8,8 +8,8 @@ import (
+ )
+ 
+ func main() {
+-	var b byte
+-	var e bool
++	var buf [16]byte
++	var index int
+ 
+ 	infile, err := os.Open("indata.dat")
+ 	if err != nil {
+@@ -28,16 +28,16 @@ func main() {
+ 	var eof bool
+ 
+ 	for !eof {
+-		b, err = reader.ReadByte()
++		buf[index], err = reader.ReadByte()
+ 		if err != nil {
+ 			eof = true
+ 		}
+ 
+-		b, e = yenc.YEnc(b)
+-		if e {
+-			writer.Write([]byte{0x3D})
++		if index == 16 || eof {
++			bytes := yenc.YEncSIMD(buf)
++			_, _ = writer.Write(bytes)
++			index = 0
+ 		}
+-		writer.Write([]byte{b})
+ 	}
+ 	writer.Flush()
+ }