[swift-dev] Questions about ARC

David P Grove groved at us.ibm.com
Wed Nov 30 12:14:33 CST 2016



> From: John McCall via swift-dev <swift-dev at swift.org>
> To: Jiho Choi <jray319 at gmail.com>
> Cc: swift-dev at swift.org
> Date: 11/30/2016 12:41 PM
> Subject: Re: [swift-dev] Questions about ARC
> Sent by: swift-dev-bounces at swift.org
>
> On Nov 30, 2016, at 8:33 AM, Jiho Choi via swift-dev <swift-dev at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20161130/95fe09d5/attachment.html>


More information about the swift-dev mailing list