+Simon Marlow
A couple of comments:
- maybe we shouldn't back the file by a Handle. io-streams does this by default out of the box; I had a posix file interface for unix (guarded by CPP) for a while but decided to ditch it for simplicity. If your results are correct, given how slow going by Handle seems to be I may revisit this, I figured it would be "good enough".
- io-streams turns Handle buffering off in withFileAsOutput. So the difference shouldn't be as a result of buffering. Simon: is this an expected result? I presume you did some Handle debugging?
- the IO manager should not have any bearing here because file code doesn't actually ever use it (epoll() doesn't work for files)
- does the difference persist when the file size gets bigger?
- your file descriptor code doesn't handle EINTR properly, although you said you checked that the file copy is being done?
-
Copying a 1MB file in 1ms gives a throughput of ~1GB/s. The other methods have a more believable ~70MB/s throughput.
G