slices: improve the performance of Equal
slices: improve the performance of Equal

Although it does an additional index operation, but it avoids the value copy of the range loop,
and it will has a better performance if E is a large structure.

Compares two int slices, the slices length are 10:
name                old time/op  new time/op  delta
Equal_WithIntSlices  5.80ns ± 0%  5.80ns ± 1%   ~     (p=0.889 n=14+15)

Compares two string slices, the slices length are 10:
name                   old time/op  new time/op  delta
Equal_WithStringSlices  17.6ns ± 1%  16.6ns ± 0%  -5.61%  (p=0.000 n=15+15)

Compares two runtime.MemStats slices, the slices length are 10:
name                        old time/op  new time/op  delta
Equal_WithLagerStructSlices  4.46µs ± 0%  1.53µs ± 1%  -65.67%  (p=0.000 n=15+15)

Change-Id: I654b4fd4d7c6c3e233e8ee963e0c510e185d398b
GitHub-Last-Rev: 274949314fd4fdfe9074d28ab959caaeb83567cb
GitHub-Pull-Request: golang/exp#24
Reviewed-on: https://go-review.googlesource.com/c/exp/+/373394
Run-TryBot: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>
Trust: Dmitri Shuralyov <d181b7fea0ec87c86ba5a890ab716db52498e3ba@golang.org>

golang/exp,golang/exp,golang/exp