Julia High Performance Computing Practice Record (2)

Sep 1, 2019

For vector and vector, vector and scalar operations, point operations should be used explicitly. Simply put, Vector.+Vectorsum Vector.*Scalaris better than Vector+Vectorsum Vector*Scalar, the time-consuming will be reduced to 1/3, and the memory usage will be reduced to 1/7.

Practice found that Julia's function is extremely fast, so that in some places, the array index has become a bottleneck. To reduce the number of indexes as much as possible, an obvious way is to merge indexes. E.g:

f = Func(W[1,2],W[2,2],W[3,2])

Can be changed to:

f = Func(W[1:3,2])	

It will be a little bit faster.

Guess you like

Origin blog.csdn.net/iamzhtr/article/details/100186305