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

I don't doubt that a good GC can generally outperform a simple refcounting scheme, but when it comes to the aforementioned count-of-one optimization, Rust already gives you that out of the box by dint of the fact that owned values are moved by default and bumping the refcount is an explicit operation, which means that in any given scope you can simply pass the handle on if you're done with it and subsequent functions can access it without needing to touch the counter at all.


rust is definitely better than other languages for refcounting, since you don't pay for it on reads




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

Search: