小编Gan*_*700的帖子

removeAll() 方法需要很长时间

List<Batch> vAllBatchList = getAllBatchCollection().toList(); //Has 700k records
List<Batch> vKeepableBatchCollection = getKeepableBatchCollection(pDaysKeepHistory).toList(); //has 600k records
vAllBatchList.removeAll(vKeepableBatchCollection);
Run Code Online (Sandbox Code Playgroud)

在上面的第 3 行 removeAll 方法花费了太多时间来完成。这里如何优化removeAll方法?

java list

1
推荐指数
1
解决办法
267
查看次数

标签 统计

java ×1

list ×1