On Sunday, 3 May 2015 at 22:02:13 UTC, Walter Bright wrote:
On 5/3/2015 2:31 PM, Ilya Yaroshenko wrote:
Can it lazily reads huge files (files greater than memory)?
If a range interface is used, it doesn't need to be aware of
where the data is coming from. In fact, the xml package should
NOT be doing I/O.
Indeed. It should operate on ranges without caring where they
came from (though it may end up supporting both input ranges and
random-access ranges with the idea that it can support reading of
a socket with a range in a less efficient manner or operating on
a whole file at once as via a random-access range for more
efficient parsing).
But if I/O is a big concern, I'd suggest just using std.mmfile to
do the trick, since then you can still operate on the whole file
as a single array without having to actually have the whole thing
in memory.
- Jonathan M Davis