es6映射和设置复杂性,v8实现 [英] es6 Map and Set complexity, v8 implementation
问题描述
这是一个公平的假设,在v8实现检索/查找是O(1)?
Is it a fair assumption that in v8 implementation retrieval / lookup is O(1)?
(我知道标准不能保证) p>
(I know that the standard doesn't guarantee that)
推荐答案
这是一个公平的假设,在v8实现检索/查找是O(1)? p>
Is it a fair assumption that in v8 implementation retrieval / lookup is O(1)?
是的。 V8使用通常对这些操作具有 O(1)
复杂度的哈希表变体。
Yes. V8 uses a variant of hash tables that generally have O(1)
complexity for these operations.
有关详细信息,您可能需要查看 https://codereview.chromium.org/220293002/ ,其中 OrderedHashTable
是基于 https://wiki.mozilla.org/User:Jorend/Deterministic_hash_tables 。
For details, you might want to have a look at https://codereview.chromium.org/220293002/ where OrderedHashTable
is implemented based on https://wiki.mozilla.org/User:Jorend/Deterministic_hash_tables.
这篇关于es6映射和设置复杂性,v8实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!