Wednesday, 14 August 2013

what's the performance of Files.readLines in Guava

what's the performance of Files.readLines in Guava

I read Guava doc:
ImmutableList<String> matchingLines = Files.readLines(
targetFile,
Charsets.UTF_8,
new LineProcessor<ImmutableList<String>>() {
final ImmutableList.Builder<String> builder = ImmutableList.builder();
@Override public boolean processLine(String line) {
if(pattern.matches(line)) builder.add(line);
return true;
}
@Override public ImmutableList<String> getResult() {
return builder.build();
}
});
so I download the source code ,find the Files.readLines not use MappedFile
technology ,
so it is less performance of using MappedFile technology.I want to read
50M file ,so how to improve the performance

No comments:

Post a Comment