tsuraan/Jerasure — pull request #11 by apeters1971 (2014-03-10 15:43:08+00:00)
Title: Adding 128-bit vector operations suppport to the region XOR function

Hi,
I made a small patch to the galois_region_xor function giving a 10-15% performance increase on INTEL CPUs with modern GNU compilers e.g. for cauchy_good or liber8tion. For older compilers the performance improvement is larger.

It uses vectorized XOR operations which seem faster than the GF multiplication functions if the parameter and alignment allows it.

I have added the code in a way that is has no impact on the default performance of the library. If you want to enable it you declare :

```
export CFLAGS="VECTOR_OP=1"
./configure
make
```

Here are few measurements Jerasure & GF-COMPLETE compiled with GCC 4.8.1
```
model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping : 7
cpu MHz : 2001.000
cache size : 20480 K
```
without VECTOR_OP:
```
# ./encoder -500000000 8 2 cauchy_good 8 4096 1048576
Encoding (MB/sec): 4790.9355499395
En_Total (MB/sec): 3046.2589655209
```
with VECTOR_OP:
```
# ./encoder -500000000 8 2 cauchy_good 8 4096 1048576
Encoding (MB/sec): 5274.1225178661
En_Total (MB/sec): 3238.9870391934
```
Here is another benchmark on a virtual machine:
```
model name	: Intel Core i7 9xx (Nehalem Class Core i7)
stepping	: 3
cpu MHz	: 2266.746
cache size	: 4096 KB
```
without VECTOR_OP:
```
./encoder -500000000 8 2 cauchy_good 8 4096 1048576
Encoding (MB/sec): 3929.0492290223
En_Total (MB/sec): 2589.0872561242
```
with VECTOR_OP :
```
./encoder -500000000 8 2 cauchy_good 8 4096 1048576
Encoding (MB/sec): 4385.6956151815
En_Total (MB/sec): 2719.6231690137
```

For reconstruction the improvement is again in the same order of magnitude (10%).

Maybe you want to give it a try and add it to the library.

I didn't do a benchmark with a CLANG compiler which should also support vector operations.