Comment

Comment by waynecochran

Optimization makes a huge difference with arrays in Swift. The following took 2.37 seconds (!) on my machine un-optimized:

     var bytes = [UInt8](count: 16_737_732, reapeatedValue: 0)
This was slow enough to block my UI (spinning pizza) -- so I ran it on a background thead!. Turn on optimization and it took a more reasonable 0.0165 seconds. BTW, took C's memset only 0.00827 seconds on the same machine.

I switched back to my beloved Objective-C for the app I was developing. Won't be using Swift for low-level image processing.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton