logoalt Hacker News

zahlmantoday at 2:19 PM0 repliesview on HN

I'm comparing to the same language implemented without the supposed internal optimization, according to my understanding of what you're doing.

But I think at this point I'd have to read and analyze the code to have a proper understanding.

... Although granting that you already have paid the cost of reference-counting GC (and, I assume, per-object allocation), it probably is indeed insignificant. And special-casing where the reference count == 1 is also kinda neat. (E.g. CPython doesn't "move references" per se if I'm thinking clearly; but it does detect cases where it can safely mutate the underlying implementation of a type that's "immutable" from the perspective of language syntax.)