查询字符串(性能对比): Array Vs HashMap
2024-08-27 18:52:12
ip字符串长度: 15
ip count: 25
time - array:16ms, 查询次数:25000
time - map:15ms, 查询次数:25000
ip count: 42
time - array:32ms, 查询次数:42000
time - map:16ms, 查询次数:42000
ip count:104
time - array:187ms, 查询次数:104000
time - map:31ms, 查询次数:104000
ip count:439
time - array:2469ms, 查询次数:439000
time - map:125ms, 查询次数:439000
根据上面的统计结果来看,当数量在 30个左右的时候,使用array或map性能差不多。
但随着数量越来越大,能明显的看出map的查询性能比array要快好几倍。
2013-08-10
最新文章
- android 打包失败
- WINCE 获取智能设备唯一编号
- expert C Programing notes
- 教程-for do、while do 中循环退出
- 如何使用KMS激活win10和office
- 【HDOJ】2526 浪漫手机
- 进入MAC下面的Library目录
- SQL 数据库连续插入大批量数据时超时
- 201621123062《java程序设计》第二周学习总结
- Nginx模块 ngx_http_limit_req_module 限制请求速率
- 《javascript设计模式与开发实践》--- (单一职责原则)
- Django 系列博客(二)
- android开发(1):底部导航条的实现 | navigation tab | activity的创建
- Python杨辉三角
- 对象new和不new的理解
- POJ 2407 Relatives(欧拉函数入门题)
- Applying the Kappa architecture in the telco industry
- Ribbon Status Bar
- sublime text 显示 typescript高亮
- centos 7网速监控脚本