[swift-dev] Questions about ARC

2016-11-30 Thread Jiho Choi via swift-dev
Hi, I am new to Swift, and I have several questions about how ARC works in Swift. 1. I read from one of the previous discussions in the swift-evolution list ( https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160208/009422.html) that ARC operations are currently not atomic as Swift

Re: [swift-dev] Questions about ARC

2016-11-30 Thread Jiho Choi via swift-dev
such techniques? On Wed, Nov 30, 2016 at 11:41 AM John McCall wrote: > On Nov 30, 2016, at 8:33 AM, Jiho Choi via swift-dev > wrote: > Hi, > > I am new to Swift, and I have several questions about how ARC works in > Swift. > > 1. I read from one of the previous discussion

Re: [swift-dev] Questions about ARC

2016-11-30 Thread Jiho Choi via swift-dev
30, 2016, at 6:25 PM, Jiho Choi via swift-dev > wrote: > > Thanks for clarifications. I have a couple of follow-up questions. > > 1. Could you please provide more information (e.g. source code location) > about the optimization applying non-atomic reference counting? What

Re: [swift-dev] Questions about ARC

2016-12-01 Thread Jiho Choi via swift-dev
ething in between, where one would use special > attributes indicating something related to thread-safety of a given > reference/type/function/etc. These hints could help a compiler to reason > about references and check if they may escape to a different thread. > > -Roman > > &

[swift-dev] How to test -assume-single-threaded option?

2017-01-13 Thread Jiho Choi via swift-dev
Hi, I want to try -assume-single-threaded option to measure the overhead of atomic operations for reference counting. However, it seems that the option works as intended with the frontend but not with the driver. In other words, I tried two commands below, and only the first command replaced ato

[swift-dev] Profiling ARC

2017-02-16 Thread Jiho Choi via swift-dev
Hi, I was curious about the overhead of ARC and started profiling some benchmarks found in the Computer Language Benchmark Game ( http://benchmarksgame.alioth.debian.org/u64q/measurements.php?lang=swift). So far, it seems that ARC sequence optimization is surprisingly good and most benchmarks don'

Re: [swift-dev] Profiling ARC

2017-02-20 Thread Jiho Choi via swift-dev
You are right that regex has many ARC operations from libFoundation. Another outlier in terms of the number of ARC operations is binary-tree. In this case, ARC operations are from the user code, and the optimizer couldn't make much difference. Other than these two, the optimizer seems working pret

Re: [swift-dev] Profiling ARC

2017-02-20 Thread Jiho Choi via swift-dev
; > > http://benchmarksgame.alioth.debian.org/u64q/program.php?test=binarytrees&lang=swift&id=1 > > Michael > > On Feb 20, 2017, at 2:24 PM, Jiho Choi via swift-dev > wrote: > > You are right that regex has many ARC operations from libFoundation. > Another outlier in terms of t

[swift-dev] Adding a field to StrongRefCount class

2017-09-25 Thread Jiho Choi via swift-dev
Hi, I want to add a field to StrongRefCount class for some experiment, but the build fails while building self-hosted 'swift-build'. I am using the version 3.1.1. Does the shape of StrongRefCount class have any implicit dependence on other parts of the runtime? What is the correct way to add a

Re: [swift-dev] Adding a field to StrongRefCount class

2017-09-27 Thread Jiho Choi via swift-dev
p 26, 2017 at 12:22 AM John McCall wrote: > > On Sep 26, 2017, at 12:56 AM, Jiho Choi via swift-dev < > swift-dev@swift.org> wrote: > > I want to add a field to StrongRefCount class for some experiment, but > the build fails while building self-hosted 'swift-

Re: [swift-dev] Adding a field to StrongRefCount class

2017-10-12 Thread Jiho Choi via swift-dev
Now I am finally able to build the Swift runtime with an extended object header and run some benchmarks. For future reference, in addition to making changes similar to the commits which Greg pointed to, I needed to change the Foundation library's CFRuntimeBase class which mirrors the Swift's objec