performance - ETS 运营运行时

标签 performance hashmap erlang ets

ets 包的delete_object 的运行时间是多少?鉴于有 n 个条目具有相同的键 kdelete_object 的运行时间是否为 O(n)或者O(1)?如果确实是 O(1)lookup 操作如何返回所有按插入时间排序的元组?

谢谢!

最佳答案

erlang 邮件列表上的这篇帖子是 2011 年的,但我认为它可能仍然有效:

http://erlang.org/pipermail/erlang-questions/2011-October/061705.html

Sverker Eriksson 给出的答案暗示查找时间为 O(n) wrt 相等键的数量:

On average constant time for insert/lookup/removal of scattered keys. A bag with lots of identical keys may give bad performance as that will result in linear searches between objects with the same key (and others that happen to hash to the same bucket).

关于performance - ETS 运营运行时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51639007/

相关文章:

java - 检查数组的长度并检查 HashMap 键是否在 HashMap 中(Java、Arrays、HashMap)

mysql - 更改 my.cnf 文件后,如何查看哪个数据库运行速度更快?

sql - 衡量 SQL 查询的性能

ruby - 将字符串转换为哈希符号的最佳方法

java - 为什么在 `HashMap Class` 中的哈希函数中使用 4,20,12,7 这样的数字

algorithm - 星搜索算法的 Erlang 实现

Erlang 语法错误, 'Or'

.net - erlang 中的 SOAP 网络服务

c# - 枚举 Hashset 的速度

java - 过时的 Java 优化技巧