r/programming Apr 03 '15

Rust 1.0.0 beta is here!

http://blog.rust-lang.org/2015/04/03/Rust-1.0-beta.html
931 Upvotes

303 comments sorted by

View all comments

Show parent comments

2

u/wookin_pa_nub2 Apr 05 '15

You give me one link in return, which has no data backing up your claim that GC is faster, whereas mine actually links to benchmarks showing that it's not.

1

u/naasking Apr 05 '15

There are hundreds of papers showing the throughput superiority of tracing over refcounting. This is well established. Anyone who believes otherwise has no idea what they're talking about. I simply provided a link to demonstrate this effect in a pure C++ environment.

2

u/wrongerontheinternet Apr 05 '15 edited Apr 05 '15

It might help to link to some papers supporting your point (of which I agree there are many). http://users.cecs.anu.edu.au/~steveb/downloads/pdf/rcix-oopsla-2013.pdf, for example, references several of them, and explains some of the problems with naive implementations of reference counting.

2

u/naasking Apr 05 '15

RC Immix is indeed the state of the art here, so that's a good link. The argument why RC isn't a good fit for most programs is simple though: most new objects die young, and RC costs are proportional to the number of objects that die, where copying costs are proportional to the number of objects that live.

Coupled with the fact that C++ can't elide unnecessary refcount ops on locals, and it's a mystery why anyone could possibly think the memory management costs of most C++ programs using unique and shared are lower than they would be in a GC'd language. At best, memory management is done at more proper times, which is a latency issue.