es6 Map and Set 复杂度,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)?
(我知道标准并不能保证)
(I know that the standard doesn't guarantee that)
推荐答案
在 v8 实现中检索/查找是 O(1) 的假设是否公平?
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<实现的/a>.
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 Map and Set 复杂度,v8 实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!