News for hackers. Stuff that matters.
Re:Introducing Swift by pohl on Tuesday June 03, 2014 @08:58AM (#7839823)
Wouldn't a lot of that be mitigated, though, by using tagged pointers in place of RC structs where possible? Seems like an obvious optimization.
Re:Introducing Swift by mzl on Wednesday June 04, 2014 @02:39AM (#7844293)
Not really sure what the tag in the pointer would be used for. Could you give an example.

In general, reference counting has the problem that it needs to update the reference count. If you have a read-only data-structure these updates to the references will introduce writes that may severely impact performance since a write introduces cache consistency communication, while reads are communication-free.

Re:Introducing Swift by pohl on Wednesday June 04, 2014 @08:51AM (#7845240)
Yeah, you're right. I didn't think it through when I asked. I conflated this scenario with the technique they use to put small objects like NSNumber on the stack.