Re:Apple is looking for engineers to convert its code from C...
by zerr on Saturday March 21, 2020 @08:49AM
(#22646169)
No, semantics and idiomatic code matters but I don't think performance oriented Swift code would be significantly slower than Rust. I might be wrong though - feel free to share relevant benchmarks.
[ Parent
| on HN ]
Re:Apple is looking for engineers to convert its code from C...
by nicklauri on Monday March 23, 2020 @04:08AM
(#22662051)
There are some benchmarks that I think you should give them a look:
https://github.com/ixy-languages/ixy-languages
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
Re:Apple is looking for engineers to convert its code from C...
by zerr on Wednesday March 25, 2020 @07:20AM
(#22683558)
Interesting, thanks! Ref counting has an overhead, of course. I wonder about the performance of the "performance oriented Swift code" - i.e. it would be non-idiomatic, but to avoid ref-counting - something you would write in your inner loop or other similar hot points.
Re:Apple is looking for engineers to convert its code from C...
by nicklauri on Wednesday March 25, 2020 @12:14PM
(#22685971)
Yes, they're programs from the benchmarks game that use a lot of UnsafeMutablePointer, which is:
> provides no automated memory management or alignment guarantees. You are responsible for handling the life cycle of any memory you work with through unsafe pointers to avoid leaks or undefined behavior. [1]
So I think they're "performance oriented Swift code". I'm not familiar with Swift, so sorry if I'm wrong. [1]: https://developer.apple.com/documentation/swift/unsafemutabl...