--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
reading a file from multiple goroutines will not necessarily kill
performance, especially when the file is served over a high latency
connection. the cp code below, which does exactly what you suggest,
may not be idiomatic go (it's a translation from a similar C program
using Plan9's go-like libthread), but it definitely outperforms the
run-of-the-mill "cp" for very large or very far away files:
go get github.com/rminnich/u-root/cp
Hi,If you open the file a load of times and start seekeing, it will kill the performance. Just open it once, have a go routine read all the data, and every N lines fire up a processor for it. I think this would be the simplest and fastest solution.
Does mmaping the file help with this sort of thing? I have to admit, I've only ever done single-threaded use of an mmaped file so I can't really speculate.