2 ms·
"Does ARC have an overhead relative to GC? If if it does, it at least prevents latency spikes" It doesn't prevent latency spikes. As an extreme example, create
by Someone 10y ago
"Does ARC have an overhead relative to GC? If if it does, it at least prevents latency spikes"
It doesn't prevent latency spikes. As an extreme example, create a linked list or tree with a billion nodes, and let its root go out of scope. That will call free a billion times.
- deleted 10y ago[deleted]
- solidsnack9000 10y agoDo that every request, and it will be the same each time. With GC, you can see a latency spike when every request creates such a list and they aren't freed until, due to memory pressure, many are freed all at once. Some of the requests will get stuck waiting for a linked list node and have very high latency relative to the other ones. The strength of ARC for interactive applications is its consistency.