Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Swift's GC is really a lot closer to modern C++ style memory management than the other languages you mentioned. If you use RAII & shared_ptr in C++ you are using the exact same techniques that Swift's "GC" uses.


And as proven by the ixy paper, quite slow versus tracing GCs.


I assume this is what you are talking about? https://www.net.in.tum.de/fileadmin/bibtex/publications/pape...

>A total of 76% of the CPU time is spent incrementing and decrementing reference counters.

ouch


Yep, that one.


Maybe. But shared_ptr should only be used very sparingly. Almost all objects should be stack or unique_ptr.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: