在 Bing.com runs on .NET Core 2.1 这篇英文博文中提到了 Vectorization
:
Vectorization of string.Equals
Vectorization of these operations is the single biggest contributor to the performance improvement we’ve measured.
请问如何理解 Vectorization
?
Vectorization may refer to:
我猜是类似于 Python /R 里面的数组操作,微软的习惯反正是先写出来能用,然后再抽空找时间优化性能。
stackoverflow 上的一个回答:
Many CPUs have "vector" or "SIMD" instruction sets which apply the same operation simultaneously to two, four, or more pieces of data. Modern x86 chips have the SSE instructions, many PPC chips have the "Altivec" instructions, and even some ARM chips have a vector instruction set, called NEON.
"Vectorization" (simplified) is the process of rewriting a loop so that instead of processing a single element of an array N times, it processes (say) 4 elements of the array simultaneously N/4 times.