Github user aarondav commented on the pull request:
https://github.com/apache/spark/pull/3900#issuecomment-69061242
Note that your test does not time the actual reading of the byte buffer,
and so the OS may not have taken any actual action yet. Here are the times for
a 2MB file where I changed the channel to copy from the returned bytebuffer
into buf.
```
15133965B file time taken with byte buffer: 648868 ns
15133965B file time taken with channel map: 598627 ns
```
Note that all this really shows, more or less, is that how long it takes to
copy from one memory location to another. Of course, opening a file will cause
the file to be mapped into virtual memory in a similar way as mapping it, but
just more explicitly a certain region and possibly with fewer kernel barriers
to access it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]