One thing that i want to add is that this whole exercise is actually a straw man. You yourself start your post with "Problem Statement : Design an algorithm that fills in a buffer of pixel data" If that is the problem, then do that. Do not fill an array with Pixel object references. It is not the same problem. I am not denying that Swift has performance issues. I do think your test and proof is artificial: nobody wou…
You can read more about them here: https://developer.apple.com/library/ios/documentation/Swift/...
I can write the same problem with components of the array as bytes if you prefer, but then performance will be even worse. The root cause of the performance issues is the array access and set. The more the do, the worse the performance.
So what you are saying, is that no person would ever create an array of data and expect to do anything with that data? And they would never do that in a processing loop? Ok...
If you actually read the blog post, you can see that I already gave an example using raw buffers (the UnsafeMutablePointer). Which means that every index into the pointer moves 4 bytes. Again, using UnsafeMutablePointer is not doing anything other than creating a harder API surface to work with.
Also, the UnsafePointer types exist because without them, there would be no way to interact with C code. And if I need to use the UnsafePointer types everywhere I have arrays so that I can have reasonable performance in debug and release builds, then there is a bigger problem that needs to be addressed.