--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/sbHgCbcGYiI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
Are there any performance issues with the seconds approach (scala.io.Source.fromFile(file).getLines()))?
If I remember correctly 5 to 10 times slower than SynchronousFileSource, *and* the Source.fromFile used (like in the above) example leaks open FileInputStreams which you never close.
SynchronousFileSource is fast, safe, and uses a dedicated thread-pool for the blocking operations by default – use it instead of hand-rolling file reading.
FYI, benchmarks (to be found in akka-bench-jmh-dev on branch release-2.3-dev):
[info] Benchmark (bufSize) Mode Cnt Score Error Units
[info] FileSourcesBenchmark.fileChannel 2048 avgt 10 711.195 ± 36.094 ms/op // this is SynchronousFileSource
[info] FileSourcesBenchmark.fileChannel_noReadAhead 2048 avgt 10 1660.726 ± 49.221 ms/op
[info] FileSourcesBenchmark.inputStream 2048 avgt 10 587.248 ± 9.179 ms/op
[info] FileSourcesBenchmark.naive_ioSourceLinesIterator 2048 avgt 10 3794.313 ± 839.539 ms/op
-- konrad
if (buffer.size > maximumLineBytes) { | |
println("XXX FAIL") | |
ctx.fail(new IllegalStateException(s"Read ${buffer.size} bytes " + | |
s"which is more than $maximumLineBytes without seeing a line terminator")) | |
} |
a.) I use SynchronousFileSource(file, 1500), does changing chunkSize will make differ huge difference in performance? As I understand (and could be totally wrong), this is how much you read from file each time, right? what is the motivation of keeping defaultChunkSize of 8192