首页 新闻 会员 周边

如何理解软件开发中的"Vectorization"概念

0
悬赏园豆:30 [已解决问题] 解决于 2018-08-23 10:48

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

dudu的主页 dudu | 高人七级 | 园豆:30994
提问于:2018-08-22 12:55
< >
分享
最佳答案
0

Vectorization may refer to:

  • Array programming, a style of computer programming where operations are applied to whole arrays instead of individual elements
  • Automatic vectorization, a compiler optimization that transforms loops to vector operations

我猜是类似于 Python /R 里面的数组操作,微软的习惯反正是先写出来能用,然后再抽空找时间优化性能。

收获园豆:30
爱编程的大叔 | 高人七级 |园豆:30839 | 2018-08-23 10:29

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.

dudu | 园豆:30994 (高人七级) | 2018-08-23 10:51
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册