4 ms·
For fun, I tried this in go on M1 Mac (basically because benchmarking in go is so easy) And... the two codes runs with exactly the same speed, on M1 Mac, with
by shp0ngle 4y ago
For fun, I tried this in go on M1 Mac (basically because benchmarking in go is so easy)
And... the two codes runs with exactly the same speed, on M1 Mac, with go.
edit: of course, with go, you can manually parallelize the faster option with goroutines... but that does something else, doesn't it. (and it's 500x faster.)
- hayley-patton 4y agoDoes the Go compiler auto-vectorise? Vectorisation appears to have been the cause of the weird performance.
- shp0ngle 4y agoNo, I don't think so.