Why Swift is 100 times slower than C in this image processing test?
This question already has an answer here:
Building with:
xcrun swift -Ofast test.swift -o test
I'm getting times of:
real 0m0.052s
user 0m0.009s
sys 0m0.005s
Let's just concentrate on the answer to the question, which started with a "Why": Because you didn't turn optimisations on, and Swift relies heavily on compiler optimisation.
That said, doing image processing in C is truly daft. That's what you have CGImage and friends for.
链接地址: http://www.djcxy.com/p/5420.html上一篇: 按值排列二维数组