We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d624763 commit 0a583adCopy full SHA for 0a583ad
ChaosCrystal/List循环性能.md
@@ -128,4 +128,21 @@ com.gcssloop.alltest I/Time: ForEach-LinkedList:5ms
128
129
## 总结:
130
131
-推荐使用迭代器(Iterator)和ForEach遍历List,不要使用传统的For循环。
+### 性能比较:
132
+
133
+测试处理10000条数据性能:
134
135
+> 数值仅供参考,与运行环境相关,每次测试结果都可能稍有差别。
136
137
+| 迭代方式 | ArrayList | LinkedList |
138
+| :--------: | :-------: | :--------: |
139
+| For循环 | 20ms | 648ms |
140
+| Iterator | 4ms | 6ms |
141
+| for-each循环 | 5ms | 5ms |
142
143
144
145
+**推荐使用迭代器(Iterator)和ForEach遍历List,不要使用传统的For循环。**
146
147
148
0 commit comments