Comment by zahlman
2 hours ago
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.)
No comments yet
Contribute on Hacker News ↗