Anyone have any objections to disabling id2ref when ObjectSpace is not
enabled? Right now, in order to support this, we have to start tracking
a weak reference to the object whenever you request #object_id. Since
most people don't actually use that ID for anything other than a number,
we could
Charles Oliver Nutter wrote:
Here's a comparison of performance for Object#object_id with and without
ObjectSpace enabled (with id2ref disabled when ObjectSpace is disabled):
Before:
1M calls to Object#object_id0.388000 0.00 0.388000 ( 0.388000)
After:
1M calls to Object#object_id
2009/5/14 Charles Oliver Nutter :
> Anyone have any objections to disabling id2ref when ObjectSpace is not
> enabled? Right now, in order to support this, we have to start tracking a
> weak reference to the object whenever you request #object_id. Since most
> people don't actually use that ID for a
Wayne Meissner wrote:
Can we leave this until 1.4 ? Nokogiri uses id2ref to map from a
pointer to a ruby object. Since this usage is going to be pretty
common in FFI, I can make a specific api for it, but thats not going
to happen overnight.
Besides .. you need to leave some of the performance