If I have to golang arrays of the same size, Is there a faster way to perform an element wise multiply than a for loop?
It looks like mat64 element wise multiplication has some optimizations for contiguous memory, but this is only for 64 bit floating point data.
A trivial example of the for loop is below
package main
import "fmt"
const size = 386
func main() {
var a, b, c [size]int
for i := 0; i < size; i++ {
a[i] = i % 16
b[i] = i
}
for i := 0; i < size; i++ {
c[i] = a[i] * b[i]
}
fmt.Printf("%v
", c[:20])
}