public class T {
private static List<Map<String, String>> fileList= new ArrayList<Map<String, String>>();
public static void main(String[] args) {
System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "100");
createFileInfo();
long startTime=System.currentTimeMillis();
fileList.parallelStream().forEach(e ->{
System.out.println(e);
});
long endTime=System.currentTimeMillis();
System.out.println("jdk8并行流耗时:"+(endTime-startTime)+"ms");
}
private static void createFileInfo(){
for(int i=0;i<30000;i++){
fileList.add(new HashMap<String, String>());
}
}
}