public class SearchTestForCPU
extends Object
比较词典查询算法的性能(比较运算速度)
#分别运行10次测试,然后取平均值
LinkedList 10000次查询 cost time:48812 ms
ArrayList 10000次查询 cost time:40219 ms
HashSet 10000次查询 cost time:8 ms
HashSet 1000000次查询 cost time:258 ms
HashSet 100000000次查询 cost time:28575 ms
Trie 10000次查询 cost time:15 ms
Trie 1000000次查询 cost time:1024 ms
Trie 100000000次查询 cost time:104635 ms
TrieV1 10000次查询 cost time:16 ms
TrieV1 1000000次查询 cost time:780 ms
TrieV1 100000000次查询 cost time:90949 ms
TrieV2 10000次查询 cost time:50 ms
TrieV2 1000000次查询 cost time:4361 ms
TrieV2 100000000次查询 cost time:483398 ms
- 作者:
- 杨尚川