> From: John McCall via swift-dev <swift-dev@swift.org> > To: Jiho Choi <jray...@gmail.com> > Cc: swift-dev@swift.org > Date: 11/30/2016 12:41 PM > Subject: Re: [swift-dev] Questions about ARC > Sent by: swift-dev-boun...@swift.org > > On Nov 30, 2016, at 8:33 AM, Jiho Choi via swift-dev <swift-dev@swift.org > > wrote: > > > > > 4. Lastly, is there a way to measure the overhead of ARC (e.g. a > compiler flag to disable ARC)? > > No, because ARC is generally necessary for correctness. >
It is imperfect, but you can get a good sense of the direct overhead of ARC for a particular workload by using a profiling tool (eg perf on Linux) and seeing what fraction of CPU cycles are spent in swift_retain and swift_release. The actual overhead of ARC is almost certainly higher, since the CPU samples don't account for lost optimization opportunities, but the profile data is easy to get and I have found it to be a useful lower bound. --dave
_______________________________________________ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev