Jeff Walden wrote:
On 07/13/2012 11:28 AM, Brendan Eich wrote:
Steve Fink wrote:
Another hole is when we use the pointer value to compute a hash code,
which we unfortunately do pretty often. For JSObjects, at least, it
would be really nice if we had an identity value to use instead.
dmandelin and I talked about this, and initially I assumed this would
require bloating up every JSObject, but David pointed out that we could
add it on as an optional property (with a private name?) so that it
would only affect objects used as keys.
You don't know which those are and don't want to add it on first use as key, 
rather see next para.

Could you elaborate on why you "don't want to add it on first use as key"?  
It's not obvious to me why this would be the case, or what would be the unwanted side 
effects of doing so.

Because many objects (most in popular workloads for which V8's nursery collection wins) are short-lived and by definition won't be moved, so they should not be taxed by an optional private-keyed identity property.

Don't walk into known performance trees head-first. Given the private-keyed identity option, there's a choice on when to add it. That choice per lots of Scheme research (I heard of this via Lars Hanson, who IIRC used it in Larceny and his GC research under Will Clinger) is on GC-move, not on first-use-as-key.

/be
_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to