I have a 1GB zip file containing about 2000 textfiles. I want to read all files and all lines as fast as possible.
try (ZipFile zipFile = new ZipFile("file.zip")) {
zipFile.stream().parallel().forEach(entry -> readAllLines(entry)); //reading with BufferedReader.readLine();
}
Result: stream.parallel() is about 30-50% faster than a normal stream.
Question: could I optimize the performance even more if I'd not be reading the stream using the parallel
API, but firering my own threads explicit to read from the file?