Thread overview | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 21, 2015 Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
https://developer.apple.com/news/?id=02202015a Interesting... Apple is dropping GC in favor of automatic reference counting. What are the benefits of ARC over GC? Is it just about predictability of resource freeing? Would ARC make sense in D? |
February 21, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to JN | On Saturday, 21 February 2015 at 19:20:48 UTC, JN wrote:
> https://developer.apple.com/news/?id=02202015a
>
> Interesting...
>
> Apple is dropping GC in favor of automatic reference counting. What are the benefits of ARC over GC? Is it just about predictability of resource freeing? Would ARC make sense in D?
Apple never was able to roll out a good GC for ObjC and got back to ARC (an overly complex reference counting system that the compiler is aware of).
You get the usual tradeof of RC vs GC :
- RC is more predictable.
- RC has less floating garbage, so usually a lower memory foot print.
- RC usually increase cache pressure as you need to have reference count ready and hot.
- RC behave (very) poorly when reference are shared across cores, as they ill compete for cache lines. It tends to be faster in single threaded mode, but that depends on the type of application (graph manipulation for instance, tend to behave poorly with RC).
- RC can leak.
- RC is unsafe without ownership.
|
February 21, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 2/21/15 12:22 PM, deadalnix wrote:
> On Saturday, 21 February 2015 at 19:20:48 UTC, JN wrote:
>> https://developer.apple.com/news/?id=02202015a
>>
>> Interesting...
>>
>> Apple is dropping GC in favor of automatic reference counting. What
>> are the benefits of ARC over GC? Is it just about predictability of
>> resource freeing? Would ARC make sense in D?
>
> Apple never was able to roll out a good GC for ObjC and got back to ARC
> (an overly complex reference counting system that the compiler is aware
> of).
>
> You get the usual tradeof of RC vs GC :
> - RC is more predictable.
> - RC has less floating garbage, so usually a lower memory foot print.
> - RC usually increase cache pressure as you need to have reference
> count ready and hot.
> - RC behave (very) poorly when reference are shared across cores, as
> they ill compete for cache lines. It tends to be faster in single
> threaded mode, but that depends on the type of application (graph
> manipulation for instance, tend to behave poorly with RC).
> - RC can leak.
> - RC is unsafe without ownership.
Apparently Apple has delivered on a well oiled RC implementation and has "won". Most people who develop for both iOS and Android prefer the former. -- Andrei
|
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to JN | On 22 February 2015 at 05:20, JN via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> https://developer.apple.com/news/?id=02202015a
>
> Interesting...
>
> Apple is dropping GC in favor of automatic reference counting. What are the benefits of ARC over GC? Is it just about predictability of resource freeing? Would ARC make sense in D?
D's GC is terrible, and after 6 years hanging out in this place, I
have seen precisely zero development on the GC front. Nobody can even
imagine, let alone successfully implement a GC that covers realtime
use requirements.
On the other hand, if 'scope' is implemented well, D may have some of
the best tools in town for quality ARC implementation. There is a
visible way forward for quality RC in D, and I think we could do
better than Apple.
I personally think ARC in D is the only way forwards. That is an unpopular opinion however... although I think I'm just being realistic ;)
|
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to JN | On Saturday, 21 February 2015 at 19:20:48 UTC, JN wrote: > https://developer.apple.com/news/?id=02202015a > > Interesting... > > Apple is dropping GC in favor of automatic reference counting. What are the benefits of ARC over GC? Is it just about predictability of resource freeing? Would ARC make sense in D? As one of the GC developers explains at Reddit, the GC never worked properly. http://www.reddit.com/r/programming/comments/2wo18p/mac_apps_that_use_garbage_collection_must_move_to/coss311 |
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On 2/21/2015 4:43 PM, Manu via Digitalmars-d wrote: > D's GC is terrible, and after 6 years hanging out in this place, I > have seen precisely zero development on the GC front. Nobody can even > imagine, let alone successfully implement a GC that covers realtime > use requirements. Nobody thinks GC is suitable for hard realtime. > On the other hand, if 'scope' is implemented well, D may have some of > the best tools in town for quality ARC implementation. There is a > visible way forward for quality RC in D, and I think we could do > better than Apple. With 'return ref', which is now implemented, you can create a memory safe RefCounted type. However, nobody has bothered. Are you up for it? :-) |
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Sunday, 22 February 2015 at 02:14:04 UTC, Walter Bright wrote: > With 'return ref', which is now implemented, you can create a memory safe RefCounted type. However, nobody has bothered. Are you up for it? :-) wait what? These things should be on the changelog! You can't really complain that people haven't bothered using a secret feature that 1) doesn't seem to be out of beta yet and 2) isn't listed as a new thing here http://dlang.org/changelog.html |
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 2/21/2015 12:22 PM, deadalnix wrote:
> You get the usual tradeof of RC vs GC :
> - RC is more predictable.
> - RC has less floating garbage, so usually a lower memory foot print.
> - RC usually increase cache pressure as you need to have reference count ready
> and hot.
> - RC behave (very) poorly when reference are shared across cores, as they ill
> compete for cache lines. It tends to be faster in single threaded mode, but that
> depends on the type of application (graph manipulation for instance, tend to
> behave poorly with RC).
> - RC can leak.
> - RC is unsafe without ownership.
- RC is slower overall
- RC has further performance and code bloat problems when used with exception handling
|
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On 2/21/2015 6:20 PM, Adam D. Ruppe wrote: > On Sunday, 22 February 2015 at 02:14:04 UTC, Walter Bright wrote: >> With 'return ref', which is now implemented, you can create a memory safe >> RefCounted type. However, nobody has bothered. Are you up for it? :-) > > wait what? These things should be on the changelog! You can't really complain > that people haven't bothered using a secret feature that 1) doesn't seem to be > out of beta yet and 2) isn't listed as a new thing here > http://dlang.org/changelog.html It's new in 2.067, which is out in beta. It implements DIP25. http://wiki.dlang.org/DIP25 |
February 22, 2015 Re: Mac Apps That Use Garbage Collection Must Move to ARC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | "Manu via Digitalmars-d" wrote in message news:mailman.7037.1424565826.9932.digitalmars-d@puremagic.com... > I personally think ARC in D is the only way forwards. That is an > unpopular opinion however... although I think I'm just being realistic > ;) A big part of why it's unpopular is that nobody, including you, wants to implement it to see if it's viable. |
Copyright © 1999-2021 by the D Language Foundation