es6 Map and Set 复杂度,v8 实现 [英] es6 Map and Set complexity, v8 implementation

查看:26
本文介绍了es6 Map and Set 复杂度,v8 实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆