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

-- 
>>>>>>>>>>      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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to