基于蘋(píng)果 Accelerate 高性能計(jì)算框架封裝庫(kù)。
性能測(cè)試對(duì)比:
import Surge let numbers: [Double] = ... var sum: Double = 0.0 // Naïve Swift Implementation sum = reduce(numbers, 0.0, +) // Surge Implementation sum = Surge.sum(numbers)運(yùn)行不同次數(shù)的對(duì)比結(jié)果: