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方法?