On Fri, Oct 3, 2008 at 11:41 AM, Dan Bron <[EMAIL PROTECTED]> wrote: > While this is a solution, it simply abtracts the entanglement into a reusable > piece of code. > It is essentially identical to the original "fetch". > > If you'll recall, the problem I was illustrating with that verb was that it > wasn't possible to > time the file-reading and data-processing aspects independently, without > re-writing my code. > > That problem persists here.
A part of the problem is that this access mechanism is designed to be efficient. The operating system will only retrieve data from the file when its block is referenced. And, even there, it might or might not have to retrieve the data from disk -- there's multiple layers of caching. So, hypothetically speaking, # onfile 'help.htm' might not read anything from disk. Or maybe the first "block" would be retrieved. Or maybe something else. On the other hand, if you are looking at repeatable times, then you can allow whatever caching exists to just happen, and you can compare the operation against the file with the operation against a similarly sized chunk of data. Or you could cold reboot between each test, to ensure that you had cleared any cache (you might need to power off, however, to ensure that there's no hardware mechanism caching data across reboots). Note also that many of these mechanisms would also apply to 1!:1, but 1!:1 might have enough overhead that you could neglect those mechanisms? -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
