4 ms·
No serious alternative? Apple could easily make a safe image handling library in Swift.
by _mlbt 2y ago
No serious alternative? Apple could easily make a safe image handling library in Swift.
- ChocolateGod 2y agoSwift is underrated, I wish it had more traction outside Apples ecosystem. Easy to learn, fast and memory safe without a GC.
- cosmic_cheese 2y agoIt’s very slowly starting to get a bit of traction outside of Apple now that the language has filled many gaps and Foundation is being re-written to be Swift-first and open source. I expect growth of adoption to continue to be slow for the time being though.
- necubi 2y agoAutomatic reference counting is a form of GC, and optimized versions of it end up very similar to tracing GC: https://web.eecs.umich.edu/~weimerw/2012-4610/reading/bacon-garbage.pdf https://web.eecs.umich.edu/~weimerw/2012-4610/reading/bacon-... (except that ARC can't handle cyclic graphs)
- IshKebab 2y agoAnd it's more deterministic without random pauses.
- pebal 2y agoThe reference counting also causes pauses when freeing large object graphs. Fully concurrent GC does not cause any pauses and it's more efficient. It also has less memory overhead per object.
- Aloisius 2y agoWhat GC doesn't cause any pauses? I know of some who claim to be "pauseless", but it's b.s. marketing. They also tend to be memory hogs that don't play well with other processes in low memory environments with the kind of allocation behavior seen in UI applications. And of course, the issue is not only stop-the-world pauses (though those are especially bad), but any pause in any thread period. A RC system lets you have consistent, predictable performance and often can be completely eliminated through static analysis.
- pebal 2y agoHere you have a GC engine that is completely pauseless: https://github.com/pebal/sgcl https://github.com/pebal/sgcl It is available as a C++ library, so you can easily compare its performance to the reference counting.
- IshKebab 2y agoThat's why I said random pauses. RAII can also cause pauses when freeing large object graphs. It's not unique to RC. However in practice it's usually much less of an issue than GC pauses. It's only been an issue for me once in my entire career.
- il-b 2y agoIn C++ one can combine RAII with allocators in order to avoid calling alloc/frees in latency critical paths.