What's the difference between deallocating memory in c++ style or with garbage collector? -
i hear c++ "faster" every language garbage collector. don't think reason, read 1 point in c++ can free memory in faster way.
assuming talk way language frees memory, true that, time speaking, if destroy every object example @ end of scope or if gc chooses when it, first way more fast?
it true, garbage collectors have price.
for example, in quantifying performance of garbage collection vs. explicit memory management paper say:
comparing runtime, space consumption, , virtual memory footprints on range of benchmarks, show runtime performance of best-performing garbage collector competitive explicit memory management when given enough memory. in particular, when garbage collection has 5 times memory required, runtime performance matches or exceeds of explicit memory management. however, garbage collection’s performance degrades substantially when must use smaller heaps. 3 times memory, runs 17% slower on average, , twice memory, runs 70% slower. garbage collection more susceptible paging when physical memory scarce. in such conditions, of garbage collectors examine here suffer order-of-magnitude performance penalties relative explicit memory management.
Comments
Post a Comment