<html><body><p><tt><br>> From: John McCall via swift-dev <swift-dev@swift.org></tt><br><tt>> To: Jiho Choi <jray319@gmail.com></tt><br><tt>> Cc: swift-dev@swift.org</tt><br><tt>> Date: 11/30/2016 12:41 PM</tt><br><tt>> Subject: Re: [swift-dev] Questions about ARC</tt><br><tt>> Sent by: swift-dev-bounces@swift.org</tt><br><tt>> <br>> On Nov 30, 2016, at 8:33 AM, Jiho Choi via swift-dev <swift-dev@swift.org<br>> > wrote:</tt><br><tt>> ><br>> > <br>> 4. Lastly, is there a way to measure the overhead of ARC (e.g. a <br>> compiler flag to disable ARC)?</tt><br><tt>> <br>> No, because ARC is generally necessary for correctness.</tt><br><tt>> <br></tt><br><tt>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.</tt><br><br><tt>--dave</tt><br><BR>
</body></html>