On Wed, 16 May 2012 11:59:37 -0400, Walter Bright <newshou...@digitalmars.com> wrote:

On 5/16/2012 7:38 AM, Steven Schveighoffer wrote:
On Wed, 16 May 2012 09:50:12 -0400, Walter Bright <newshou...@digitalmars.com>
wrote:

On 5/15/2012 3:34 PM, Nathan M. Swan wrote:
I do agree for e.g. with binary data some data can't be read with ranges (when
you need to read small chunks of varying size),

I don't see why that should be true.

How do you tell front and popFront how many bytes to read?

std.byLine() does it.

Have you looked at how std.byLine works? It certainly does not use a range interface as a source.

In general, you can read n bytes by calling empty, front, and popFront n times.

I hope you are not serious! This will make D *the worst performing* i/o language.

This should be evidence enough:

steves@steves-laptop:~$ time dd if=/dev/zero of=/dev/null bs=1 count=1000000
1000000+0 records in
1000000+0 records out
1000000 bytes (1.0 MB) copied, 0.74052 s, 1.4 MB/s

real    0m0.744s
user    0m0.176s
sys     0m0.564s
steves@steves-laptop:~$ time dd if=/dev/zero of=/dev/null bs=1000 count=1000
1000+0 records in
1000+0 records out
1000000 bytes (1.0 MB) copied, 0.00194096 s, 515 MB/s

real    0m0.006s
user    0m0.000s
sys     0m0.004s

-Steve

Reply via email to