Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread Marja Hölttä
Re: what Ross said. Yes, exactly, we compute the hashes once when inserting into AstValueFactory and reuse them when internalizing the strings to avoid hashing twice. No other reason. -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received

Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread Leszek Swirski
I've definitely seen cases of the hash function being passed in as key->hash(). If that's the case, then the templated hash function could, for example, look up the hash on the key object. On Thu, Sep 15, 2016 at 9:43 AM, 'Ross McIlroy' via v8-dev < v8-dev@googlegroups.com> wrote: > On 15 Sep

Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread 'Ross McIlroy' via v8-dev
On 15 Sep 2016 9:29 a.m., wrote: > > Hi all, > > We (ignition) are looking to use base/hashmap (TemplateHashMap), but there are a couple of things that I want to change/add for efficiency's sake. Because these changes would have far-reaching effects, I wanted to send out the

Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread Leszek Swirski
Good question, and one I tried at first. Unfortunately, std::unordered_map<> has some disadvantages, namely re-hashing my hashes (which I profiled and it had a noticeable performance penalty), no support (that I could find) for a LookupOrInsert of a non-default value, and prime-number bin counts

Re: [v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread Jochen Eisinger
would replacing it with std::unordered_map<> gain the same advantages? On Thu, Sep 15, 2016 at 10:29 AM wrote: > Hi all, > > We (ignition) are looking to use base/hashmap (TemplateHashMap), but there > are a couple of things that I want to change/add for efficiency's sake.

[v8-dev] TemplateHashMap changes proposal

2016-09-15 Thread leszeks
Hi all, We (ignition) are looking to use base/hashmap (TemplateHashMap), but there are a couple of things that I want to change/add for efficiency's sake. Because these changes would have far-reaching effects, I wanted to send out the proposed changes before trying to upload any CLs. My